Hello all,
I am trying to use the TGColorFrame class to show some status information. I have it inside a TGHorizontalFrame, which is inside a TGCompositeFrame, which is inside a TGMainFrame.
When I change the background color for the TGColorFrame from white to black, like this :
fColor->ChangeBackground(0); // put black color (fColor is a pointer to TGColorFrame class)
I don’t see any chage.
Do I have to call some function to make the update ?
Thanks,
Paulo da Silva
Hi Paulo,
I have a working macro where I am using the RGB colors (it is for having the same color on different platforms as linux, windows, mac, etc.), i.e.:
fColor->ChangeBackground(TColor::RGB2Pixel(0xFF, 0xFF, 0x00)); // yellow
fColor->ChangeBackground(TColor::RGB2Pixel(0x00, 0x00, 0x00)); // black
etc. … Could you please try this way and let me know what is the result.
Thank you, Ilka
Hi Ilka,
the problem I have is not selecting the colors. The problem is that after I issue the command the background doesn’t get updated.
I am using the program outside ROOT, compiling using Visual C++.
I wonder if there is some Update or Paint method that I should call.
Thank you,
Paulo
Hi Paulo da Silva,
use gClient->NeedRedraw(frame) for frame which
you would like update/repaint.
Regards. Valeriy
Hi Paulo,
Sorry for misunderstanding - as Valeriy said you should use
gClient->NeedRedraw(fColor);
Cheers, Ilka
Hello Ilka and Valeriy,
thank you all for the answers. Now it works.
Regards,
Paulo