Re: [ROOT] cd to subpads

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Oct 25 2000 - 12:05:40 MEST


Hi Stefan,

The ROOT C++ extension of looking at existing objects and create
a pointer automatically looks only into the current canvas and the first level
of pads in the current canvas. In your example below, you can use the fact
than gPad is the pointer to the current pad and do gPad->cd(1) instead.

Rene Brun


Stefan Stonjek wrote:
> 
> Hello,
> 
> this script gives an error message for the last command
> ================================================
> {
>   TCanvas *c1 = new TCanvas("c1","c1",800,600);
>   c1->Divide(2,2);
>   c1_1->Divide(2,2);
>   // this works
>   c1->cd(1);
>   c1_1->cd(1);
>   // this does not work
>   c1_1_1->cd();
> }
> ================================================
> Error: No symbol c1_1_1 in current scope FILE:/home/stonjek/afs/root/cd_test.C LINE:9
> ================================================
> 
> but a dump show that an object c1_1_1 exists
> 
> ==================================================
> fName.*fData             c1_1_1
> fTitle.*fData            c1_1_1
> ==================================================
> 
> Is this a bug or a feature? What is the correct way to hadle this subpads?
> 
> Tschuess
>         Stefan
> 
> *********      Stefan  Stonjek     *********
> *****            DESY / ZEUS           *****
> *****      Stefan.Stonjek@desy.de      *****
> *********  Tel.: +49-40-8998-3159  *********



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET