Re: Changing freely the color of a TGTab

Fons Rademakers (Fons.Rademakers@cern.ch)
Wed, 03 Feb 1999 12:52:30 +0100


This already can be done now, albeit a bit clumsily. See
$ROOTSYS/test/guitest.cxx.

In current version:

// Change background of fTestButton to green
SetWindowAttributes_t wattr;
wattr.fMask = kWABackPixel;
gClient->GetColorByName("green", wattr.fBackgroundPixel);
gGXW->ChangeWindowAttributes(fTestButton->GetId(), &wattr);

In new version:

// Change background of fTestButton to green
ULong_t green;
gClient->GetColorByName("green", green);
fTestButton->ChangeBackground(green);

gtestButton is a TGTextButton.

Cheers, Fons.

Wei Xie wrote:
>
> Dear Fons,
>
> That's fantastic ! I'll put the implementation into my code right after
> I get the new version !
>
> One more question is :
>
> Is it also possible to change freely the color of a TGTextButton. Now
> what I can do is to set initially the color of those Text in a button but
> the button itself is still colorless.
>
> It seems quite necessary that this can be done as free as possible since
> different color can directly show the status of a monitered object.
>
> Sincerely yours
> 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