Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370997 - Setting font to a table scrolls it to the top
Summary: Setting font to a table scrolls it to the top
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 370989 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-08 14:36 EST by Remy Suen CLA
Modified: 2019-11-14 03:48 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.