Hi Rene,
The Error with "stt" pointer I have sent by mistake because I have 2
blocks in my script: with "stt" and "st". So, with the mentioned below
example is connected following error message:
Error: illegal pointer to class object st 0x0 122 FILE:run_reco.C LINE:95
//(Line 95 is shown below)
Yesterday I have found that error message does not appear if I insert
"c0->Update();" before definition of "st" pointer:
TCanvas *c0 = new TCanvas("c0","Canvas",700,500);
h1->Draw();
c0->Update(); // <============
TPaveStats *st = (TPaveStats*) c0->GetPrimitive("stats");
st->SetName("AAA"); // <----------- "Line 95"
Thank you,
- Dmitriy -
On Thu, 7 Jun 2001, Rene Brun wrote:
> Hi Dmitriy,
>
> It seems that you have a typing mistake.
> From the error message, it seems that you typed stt instead of st.
> I tested your example and it works correctly.
>
> Rene Brun
>
> Dmitriy Bandourine wrote:
> >
> > Hi dear Rooters,
> >
> > I have tried to obtain a new statistics box with my named script
> > "run_reco.C" by the strings taken from User's guide v07 :
> >
> > [...]
> > TCanvas *c0 = new TCanvas("c0","Canvas",700,500);
> > h1->Draw();
> > TPaveStats *st = (TPaveStats*) c0->GetPrimitive("stats");
> > st->SetName("AAA");
> > st->SetX1NDC(.55);
> > st->SetX2NDC(.75);
> > st->SetTextColor(2);
> > h2->Draw("sames");
> > [...]
> >
> > but I've got:
> > Error: illegal pointer to class object stt 0x0 122 FILE:run_reco.C LINE:95
> >
> > What's wrong in the code?
> >
> > - Dmitriy -
>
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:49 MET