[ROOT] Compatible Color Palettes

From: simon (simon@ligo.mit.edu)
Date: Mon Jun 11 2001 - 18:35:15 MEST


hi rooters, 
	
	i made a GUI in which i have problems with the color palette. I need for 
the TText::SetTextColor(col) to be the exactly the same as my 
TGTextButton::SetBackgroundColor(col). Since TText seems to be using the 
gStyle->fPallette (with default 50 colors) and that TGButtons seem to be using 
the TGX11:gColors[], i tried the following:


 for(int i=0; i<gStyle->GetNumberOfColors(); i++)
    {
      float r,g,b;

      gROOT->GetColor(i)->GetRGB(r,g,b);
    
      X->SetPubRGB(i,r,g,b);
    }

where  X is a  TidX11:public TGX11  object 
that has a method SetPubRGB(int i, float r, float g, float b){ SetRGB(i,r,g,b);}	
in order to acess the private TGX11::SetRGB()   
    
I thought this would make colors of the TGX11 corresponding to the first 50 
index numbers to be exactly the same as the 50 colors of the gStyle palette but 
it doesn't affect the TGButtons color at all... does anyone know how to make the 
color index compatible from TText to TGButton ???

thanks



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:49 MET