Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Checkbox and non-checkbox items in a SWT tree
Checkbox and non-checkbox items in a SWT tree [message #448688] Thu, 13 January 2005 08:30 Go to next message
Eclipse UserFriend
Originally posted by: mathieu.watel.axlog.fr

Hi,

I want to know how to create a SWT tree where you can both have checkbox
item nodes and non checkbox items. Now, i have the code below that will
just put checkboxes at each node :

Tree myTree = new Tree(parent, SWT.SINGLE | SWT.CHECK);
TreeItem myItem = new TreeItem(myTree, SWT.NONE);
myItem.setText("item 1");
myItem = new TreeItem(myItem, SWT.NONE);
myItem.setText("subitem 1");

If I only want to have a checkbox on the subitem, what is the procedure ?
Moreover, I don't understand why we must give a style parameter to the
constructor of TreeItem as it doesn't change anything. In the
documentation it is said that there aren't any style for this kind of
object...

Thanks in advance for your help !
Re: Checkbox and non-checkbox items in a SWT tree [message #449010 is a reply to message #448688] Mon, 17 January 2005 17:46 Go to previous message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Can't do it. The native Windows tree (for example), forces you to have a
check box on each item.

"Mathieu Watel" <mathieu.watel@axlog.fr> wrote in message
news:cs5bk1$tc$1@www.eclipse.org...
> Hi,
>
> I want to know how to create a SWT tree where you can both have checkbox
> item nodes and non checkbox items. Now, i have the code below that will
> just put checkboxes at each node :
>
> Tree myTree = new Tree(parent, SWT.SINGLE | SWT.CHECK);
> TreeItem myItem = new TreeItem(myTree, SWT.NONE);
> myItem.setText("item 1");
> myItem = new TreeItem(myItem, SWT.NONE);
> myItem.setText("subitem 1");
>
> If I only want to have a checkbox on the subitem, what is the procedure ?
> Moreover, I don't understand why we must give a style parameter to the
> constructor of TreeItem as it doesn't change anything. In the
> documentation it is said that there aren't any style for this kind of
> object...
>
> Thanks in advance for your help !
>
>
Previous Topic:When to use multi-UI threading ?
Next Topic:setLocation() problem
Goto Forum:
  


Current Time: Thu Nov 14 21:13:49 GMT 2019

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

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

Back to the top