Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » [newbie] Setting the size of a Tree
[newbie] Setting the size of a Tree [message #445713] Tue, 09 November 2004 23:25 Go to next message
Eclipse UserFriend
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>
found ))) was (Re: [newbie] Setting the size of a Tree) [message #445739 is a reply to message #445713] Wed, 10 November 2004 11:40 Go to previous message
Eclipse UserFriend
Originally posted by: yvon_thoraval.mac.com

Yvon Thoraval a écrit :
> [blahblahblah]
I've found running examples at <http://www.cs.umanitoba.ca/~eclipse/>

@+

Yvon
Previous Topic:TableExample from Tobias Weih
Next Topic:Modifying the default behaviour of TrayItem
Goto Forum:
  


Current Time: Thu Apr 25 18:12:55 GMT 2024

Powered by FUDForum. Page generated in 0.03170 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top