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

Bug 363712

Summary: scrolled Tree gives incorrect y bounds values
Product: [Eclipse Project] Platform Reporter: Grant Gayed <grant_gayed>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, lshanmug, Silenio_Quarti
Version: 4.2   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Grant Gayed CLA 2011-11-14 10:48:05 EST
- run the snippet below, and note that the printed client rect y and top item bounds y are large numbers (> 700), but should both be around 0

public static void main(String[] args) {
    final Display display = new Display();
    Shell shell = new Shell(display);
    Tree tree = new Tree(shell, SWT.NONE);
	tree.setBounds(10,10,300,300);
	for (int i = 0; i < 99; i++) {
		new TreeItem(tree, SWT.NONE).setText("root " + i);
	}
	tree.select(tree.getItem(55));
	shell.pack();
    shell.open();
    System.out.println("client rect: " + tree.getClientArea());
    TreeItem topItem = tree.getTopItem();
    System.out.println("top item: " + topItem.getText());
    System.out.println("top item bounds: " + topItem.getBounds());
    while (!shell.isDisposed()) {
    	if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
}
Comment 1 Silenio Quarti CLA 2012-02-01 14:56:33 EST
This is expected behaviour on Mac. The client area changes as you scroll the tree/table/list widget.