[newbie] Setting the size of a Tree [message #445713] |
Tue, 09 November 2004 23:25 |
Eclipse User |
|
|
|
Originally posted by: yvon_thoraval.mac.com
Hey all,
i've followed some article on the net about the tree widget.
it works well except the fact i get a very small area for the on the
display.
the setSize on tree seems to have no effect..
Any advice ?
basically my test is as :
<code>
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new RowLayout());
[...]
final Tree tree = new Tree(shell, SWT.SINGLE);
while (os.hasNext()) {
[...]
for (int c = 0; c < cts.size(); c++) {
[...]
final TreeItem item1 = new TreeItem(tree, SWT.NULL);
item1.setText(name);
[...]
final TreeItem item11 = new TreeItem(item1, SWT.NULL);
item11.setText(areaName);
for (int s = 0; s < subAreas.size(); s++) {
[...]
final TreeItem item111 = new TreeItem(item11,
SWT.NULL);
item111.setText(subAreaName);
}
}
}
// Logger.log(A01_Get_WorldAppellations.db, os.next());
}
A01_Get_WorldAppellations.db.close();
tree.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
System.out.println("Selection:" + tree.getSelection()[0]);
}
});
tree.setSize(450, 250);
shell.pack();
shell.open();
shell.setSize(500, 300);
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
</code>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03170 seconds