Aihong,
I believe that this is correctly explained in the Users Guide.
If you are not aware that a Users Guide exists, see the Root main Web page
or go directly to:
http://root.cern.ch/root/RootDoc.html
If you do not like docs, you can read a short explanation at the HOWTO:
http://root.cern.ch/root/HowtoDraw.html
Rene Brun
Aihong Tang wrote:
>
> Hi, Rene & All:
>
> I've seen a few times about the Update() on this list. Could anybody
> explain under what conditions this TCanvas:Update() need to be called?
>
> Thanks!
>
> Aihong
>
> On Tue, 19 Dec 2000, Rene Brun wrote:
>
> > Andre,
> > Add the line
> > c5->Update();
> > after the line
> > c5->Divide(3,2);
> >
> > Otherwise, when you call gROOT->GetSelectedPad, there is no canvas
> > "Paint" at this time.
> >
> > Rene Brun
> >
> > Andre Holzner wrote:
> > >
> > > Hello,
> > >
> > > what am I doing wrong with this macro ?
> > > The first time I run it, it produces an empty canvas
> > > (and I see the complaint messages). Running it again,
> > > I get a new canvas with all the frames in it (as I
> > > want them). Can anybody reproduce the problem ?
> > >
> > > void test()
> > > {
> > > TCanvas *c5 = new TCanvas;
> > > c5->cd();
> > > c5->Divide(3,2);
> > >
> > > int i;
> > > for (i=0; i<6; ++i)
> > > {
> > > c5->cd(i+1);
> > >
> > > TPad *pad = gROOT->GetSelectedPad();
> > > if (pad == NULL)
> > > cout << "GetSelectedPad() returns NULL" << endl;
> > > else
> > > pad->DrawFrame(105,-8,120,8);
> > > }
> > > }
> > >
> > > thanks for looking at it,
> > >
> > > Andre
> > >
> > > --
> > > ------------------+----------------------------------
> > > Andre Holzner | +41 22 76 76750
> > > Bureau 32 2-C13 | Building 32
> > > CERN | Office 2-C13
> > > CH-1211 Geneve 23 | http://wwweth.cern.ch/~holzner/
> >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:40 MET