TPad::GetPrimitive

From: Carlos Munoz Camacho <cmunoz_at_clipper.ens.fr>
Date: Wed, 8 Jun 2005 16:11:21 +0200 (MEST)

Hi,

    If I type in a ROOT session:

TH1F *h=new TH1F("h","h",100,-1,1);
h->Draw();
TPaveStats *st=(TPaveStats*)gPad->GetPrimitive("stats"); st->SetX1NDC(0.1);
h->Draw();

that works fine. Now if a do it in a macro (adding a couple of {} ):

{
TH1F *h=new TH1F("h","h",100,-1,1);
h->Draw();
TPaveStats *st=(TPaveStats*)gPad->GetPrimitive("stats"); st->SetX1NDC(0.1);
h->Draw();
}

ROOT complains like this:

Error: illegal pointer to class object st 0x0 323 FILE:(tmpfile) LINE:5 *** Interpreter error recovered ***

This is ROOT 4.00/08 on Linux. Any hints ?

Carlos

Is there any other (better) way of changing the size of the statbox ? Received on Wed Jun 08 2005 - 16:11:26 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:09 MET