Re: gPad

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Mon Feb 28 2000 - 13:02:02 MET


Hi Rutger,

   in the current version gPad is actually a function with the name Pad().
So you can use if (Pad())... However, due to possible name clashes with
other global functions from other libraries we've changed Pad() to R__Pad()
in the coming release. So, use Pad() now and change to R__Pad() when you 
get the next release.

Cheers, Fons.


Rutger van der Eijk wrote:
> 
> Hi,
> 
> When is gPad known in an interactive ROOT session? I know gPad became a
> macro to improve thread support. However if I just start interactive ROOT,
> gPad is not know until I draw some object. This is inconvenient because I,
> e.g. want to check if a canvas is already present.
> 
> i.e. the macro
> 
>   // create pad
>   if (!gPad) {
>     if (!gROOT->GetMakeDefCanvas()) return;
>     (gROOT->GetMakeDefCanvas())();
>   }
>   gPad->Clear();
> 
> crashes with:
> 
> Error: No symbol gPad in current scope  FILE:/tmp/29646eaa_cint LINE:1
> 
> I probably missed a roottalk or release note about this (because more ppl
> should have this), or am doing something stupid. Can anybody point me out
> to the documentation? (Version   2.23/12   1 February 2000)
> 
> cheers,
> 
> Rutger

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



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