Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370997

Summary: Setting font to a table scrolls it to the top
Product: [Eclipse Project] Platform Reporter: Remy Suen <remy.suen>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eiswind, gheorghe
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Remy Suen CLA 2012-02-08 14:36:19 EST
1. Run the snippet.
2. Scroll the table to the bottom.
3. Click the button.
4. The table scrolls to the top!

---------------

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());

final Table table = new Table(shell, SWT.NONE);
for (int i = 0; i < 20; i++) {
  new TableItem(table, SWT.LEAD).setText(String.valueOf(i));
}

new Button(shell, SWT.PUSH).addListener(SWT.Selection, new Listener() {
  public void handleEvent(Event event) {
    table.setFont(table.getFont());
  }
});

Point size = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
shell.setSize(size.x, size.y / 2);
shell.open();
while (!shell.isDisposed()) {
  if (!display.readAndDispatch())
    display.sleep();
}
display.dispose();
Comment 1 Remy Suen CLA 2012-02-09 11:18:46 EST
*** Bug 370989 has been marked as a duplicate of this bug. ***
Comment 2 Remy Suen CLA 2012-02-09 11:19:12 EST
Bogdan, this is the font table scrolling problem I showed you earlier today.
Comment 3 Lars Vogel CLA 2019-11-14 03:48:16 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.