Checkbox and non-checkbox items in a SWT tree [message #448688] |
Thu, 13 January 2005 03:30  |
Eclipse User |
|
|
|
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 12:46  |
Eclipse User |
|
|
|
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 !
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03325 seconds