Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363712 - scrolled Tree gives incorrect y bounds values
Summary: scrolled Tree gives incorrect y bounds values
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-14 10:48 EST by Grant Gayed CLA
Modified: 2012-02-01 14:56 EST (History)
3 users (show)

See Also:


Attachments

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