Re: TGListTree

Fons Rademakers (Fons.Rademakers@cern.ch)
Tue, 16 Mar 1999 18:10:55 +0000


Hi Anton,

search in http://root.cern.ch/root/html/src/TRootBrowser.cxx.html
for kC_LISTTREE to see how 'which button' and 'location' are used.

It is not easily possible to handle multiple TGListTree's in the same
ProcessMessage method (since there is no ID like with buttons).
What you could do is to use the 'location' to see in which TGListTree
you are (by using the TGListTree's TGFrame::GetX(), GetY(), Width()
and Height() and compare them to the event's location).
Otherwise you can handle the other TGListTree's in the ProcessMessage
of an additional TGCompositeFrame in which you embed the tree
(using the Associate() method).

Cheers, Fons.

Anton Fokin wrote:
>
> Hi there,
>
> could someone explain me what is the meaning of the following:
>
> ----
> A list tree can generate the following events:
> kC_LISTTREE, kCT_ITEMCLICK, which button, location (y<<16|x).
> kC_LISTTREE, kCT_ITEMDBLCLICK, which button, location (y<<16|x).
> ----
>
> what are "which button" and "location". I would also like to know how to
> handle events from TWO different TGListTrees belonging to one dialog
> window, i.e. how to distinguish between them.
>
> Yours,
>
> Dr. Anton Fokin
>
> Division of Cosmic and Subatomic Physics
> Lund University
> Sweden

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910