Re: [ROOT] exec1.C Example

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Apr 13 2000 - 11:27:33 MEST


Hi Norbert,
Thanks for reporting the problem and giving the solution.
I forgot to update this macro after the changes in Root regarding gPad.

Rene Brun

Norbert Danneberg wrote:
> 
> Hi
> 
> the exec1.C example, provided with version 2.23/11
> worked in my case only after a modification in
> line 16.
> 
> I used
> 
>       Float_t xx = gPad->AbsPixeltoX(px);
>       Float_t x = gPad->PadtoX(xx);
> 
> instead of
> 
>       Float_t x = gPad->PadtoX(gPad->AbsPixeltoX(px));
> 
> The second statement produced the follwing error:
> 
> root [0] TFile f("hsimple.root")
> root [1] hpx.Draw()
> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> root [2] c1.AddExec("ex1",".x exec1.C")
> root [3] Error: No symbol gPad in current scope
> FILE:/home/muptdev/Offline/Macros/exec1.C LINE:16
> Error: Failed to evaluate gPad->AbsPixeltoX(px)
> FILE:/home/muptdev/Offline/Macros/exec1.C LINE:16
> Possible candidates are...
> filename       line:size busy function type and name
> *** Interpreter error recovered ***
> 
> 
> Norbert



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