|
Re: Tree widget [message #442299 is a reply to message #442298] |
Wed, 01 September 2004 00:33 |
Simone Gianni Messages: 29 Registered: July 2009 |
Junior Member |
|
|
Hi Melih,
maybe
tree.setSelection(new TreeItem[] { selectedItem });
could do the trick.
Ciao,
Simone Gianni
Melih wrote:
> Hi,
>
> I created a Tree widget with:
>
> avTree = new Tree(avTreeGroup,SWT.SINGLE| SWT.CHECK| SWT.BORDER);
>
> After I added some TreeItems and run the program, I realized that if I
> click on the name of a TreeItem, it gets highlighted, but clicking on the
> checkbox next to a TreeItem just un/checks the box, it doesn't highlight
> that item. How can I fix that?
>
> If I added a SelectionListener, and get the widget whose checkbox is
> modified by:
> TreeItem selectedItem = (TreeItem) evt.item;
>
>
> then how can I highlight that item?
>
> Thanx
> melih
>
>
>
|
|
|
Re: Tree widget [message #442300 is a reply to message #442299] |
Wed, 01 September 2004 01:04 |
Melih Messages: 2 Registered: July 2009 |
Junior Member |
|
|
Thanx Simone. But wouldn't it change the current selection array as well?
melih
Simone Gianni wrote:
> Hi Melih,
> maybe
> tree.setSelection(new TreeItem[] { selectedItem });
> could do the trick.
> Ciao,
> Simone Gianni
> Melih wrote:
> > Hi,
> >
> > I created a Tree widget with:
> >
> > avTree = new Tree(avTreeGroup,SWT.SINGLE| SWT.CHECK| SWT.BORDER);
> >
> > After I added some TreeItems and run the program, I realized that if I
> > click on the name of a TreeItem, it gets highlighted, but clicking on the
> > checkbox next to a TreeItem just un/checks the box, it doesn't highlight
> > that item. How can I fix that?
> >
> > If I added a SelectionListener, and get the widget whose checkbox is
> > modified by:
> > TreeItem selectedItem = (TreeItem) evt.item;
> >
> >
> > then how can I highlight that item?
> >
> > Thanx
> > melih
> >
> >
> >
|
|
|
Re: Tree widget [message #442303 is a reply to message #442300] |
Wed, 01 September 2004 08:21 |
Simone Gianni Messages: 29 Registered: July 2009 |
Junior Member |
|
|
AFAIK, when a Tree has checks, it has two different "selections", one is
retrieved and set item by item with treeItem.setChecked() which refers
to the check; the other is get and set on the entire tree with
setSelection and getSelection and refers to the highlighted ones. They
are not necessarily coupled, at least not on Win XP, at least not in my
checked tree experiences :D
Ciao,
Simone Gianni
Melih wrote:
> Thanx Simone. But wouldn't it change the current selection array as well?
>
> melih
>
> Simone Gianni wrote:
>
>
>>Hi Melih,
>>maybe
>
>
>>tree.setSelection(new TreeItem[] { selectedItem });
>
>
>>could do the trick.
>
>
>>Ciao,
>>Simone Gianni
>
>
>>Melih wrote:
>
>
>>>Hi,
>>>
>>>I created a Tree widget with:
>>>
>>>avTree = new Tree(avTreeGroup,SWT.SINGLE| SWT.CHECK| SWT.BORDER);
>>>
>>>After I added some TreeItems and run the program, I realized that if I
>>>click on the name of a TreeItem, it gets highlighted, but clicking on the
>>>checkbox next to a TreeItem just un/checks the box, it doesn't highlight
>>>that item. How can I fix that?
>>>
>>>If I added a SelectionListener, and get the widget whose checkbox is
>>>modified by:
>>>TreeItem selectedItem = (TreeItem) evt.item;
>>>
>>>
>>>then how can I highlight that item?
>>>
>>>Thanx
>>>melih
>>>
>>>
>>>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02082 seconds