Re: How can I know which Tab is select

Fons Rademakers (Fons.Rademakers@cern.ch)
Mon, 03 Aug 1998 12:54:35 +0200


Hi Xie,

in version 2.00/10 there is no event generated when clicking on
a tab of a TGTab so there is no way to be notified when a tab is being
activated. You can only call TGTab::GetCurrent() to find out which tab
is active in response to some other event.

However, in the dev version I've modified TGTab to generate an event
when a tab gets selected. If you really want this feature now you
can download the sources of the dev version:
ftp://root.cern.ch/root/root_v2.00.source.dev.tar.gz
and you must compile the distribution yourself (only makefiles for
Linux and HP are provided). To see how to handle this new TGTab
event see the new $ROOTSYS/test/guitest.cxx.

Cheers, Fons.

Wei Xie wrote:
>
> Dear Rooters,
>
> I have a tab widget that contains 3 tabs: tb1, tb2, tb3.
> My question is when click each tab with a mouse, how the
> program can know which tab is clicked so that it can do
> some other jobs corresponding to the contents of the clicked
> tab composite frame.
>
> Sincerely
>
> Xie

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