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

Bug 347694

Summary: getting client area makes horizontal scrollbar not appear
Product: [Eclipse Project] Platform Reporter: Grant Gayed <grant_gayed>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: ericwill
Version: 3.7Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Grant Gayed CLA 2011-05-30 16:20:05 EDT
- 3.7RC3 build
- observed on RHEL6 on PPC64, probably happens on all gtk platforms

- run the snippet below, note that its horizontal scrollbar appears fine
- now uncomment the line in the MeasureItem listener, run the snippet again, and note that the needed horizontal scrollbar is not shown

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setBounds(10,10,200,250);
    final Table table = new Table(shell, SWT.NONE);
    table.setBounds(10,10,100,200);
    table.setLinesVisible(true);
    for (int i = 0; i < 5; i++) {
        new TableItem(table, SWT.NONE).setText("an item that's a bit long " + i);
    }
    table.addListener(SWT.MeasureItem, new Listener() {
        public void handleEvent(Event event) {
            //    table.getClientArea(); // <---
        }
    });
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
}
Comment 1 Eric Williams CLA 2018-05-14 14:01:56 EDT
I cannot reproduce this issue on 4.8 M7, GTK3.22, and Fedora 28. Please comment if the issue reappears.