[ROOT] TPaveText + TPad + TCanvas = no update

From: Brett Viren (bv@bnl.gov)
Date: Thu Mar 14 2002 - 21:45:10 MET


Consider the following:

TCanvas* canvas=0;
TPad* pad=0;
TPaveText* tpt=0;
void make_stuff()
{
    canvas=new TCanvas("blah","blah");
    // intermediate TPad:
    pad=new TPad("blah","blah",0.2,0.2,0.8,0.8);
    pad->SetFillColor(2);
    pad->Draw();
    pad->cd();
    //
    tpt = new TPaveText(0.2,0.2,0.8,0.8);
    tpt->AddText("blah blah blah");
    tpt->Draw();
}
void change_stuff()
{
    tpt->Clear();
    tpt->AddText("new text");
}


After loading this macro into root do:

root [1] make_stuff()
root [2] change_stuff()
root [3] canvas->Modified()
root [4] canvas->Update()  

And note that the TPaveText is not updated.  If one calls:

root [5] pad->Modified()   

then the "new text" is displayed.  Also, if one removes the
intermediate TPad and Draw()s directly into the TCanvas [1]-[4] work
as expected.

Is this a bug, or must I keep track of all sub TPads and explicitly
call Modified() and Update() on them?

-Brett.



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:45 MET