Re: tweaking the stats box

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri May 14 1999 - 16:40:42 MEST


Hi Chris,
You get a crash because the stats object does not exists at the time
you invoke SetTextColor.
Simply add the folowing statement before SetTextColor:
   gPad->Update();

Rene Brun

On Fri, 14 May 1999, Chris Jillings wrote:

> Hello,
>     I am looping through a list of pads drawing histograms with the loop
> 
> for( i=0 ; i<9 ; i++ ) {
>   p1->cd(i+1);
>   h[8-i]->Draw();
>   //gPad->GetListOfPrimatives()->FindObject("stats")->SetTextColor(kBlue);
> }
> 
>   When the line is commented out, everything works as expected.
> When I include the line, the macro fails on that line. I tried breaking
> the line into 2 smaller lines by explicitly decalring a TPaveText pointer
> and getting the stats box and then getting at the text in a second line.
> That did not work either. Also, is there a shortcut to get at the stats
> box? I didn't see a TPad::GetStatsBox() member function, or something
> along that line, in the class guide.
> 
> Thanks in advance,
> 
> Chris
> 
> 
> 
> 
> ==================================================================
> =                                                                =
> = Chris Jillings                                                 =
> = Department of Physics   phone/voice mail: (613) 533-6000x74805 =   
> = Queen's University      fax: (613) 533-6813                    =
> = Kingston, Ontario       email: chris@sno.phy.queensu.ca        =             
> = Canada, K7L 3N6         web: http://sno.phy.queensu.ca         =
> =                                                                =
> ==================================================================
> 
> 
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:33 MET