Hi all.
How can I store (and restore) a TLegend-Object in a ROOT-Directory. To store i use the following (sorry for dirty CINT syntax )
legend = new TLegend(0.4,0.5,0.6,0.7);
legend->SetName(“myLegend”);
gDirectory->GetList()->Add(legend) ;
// compare with other objects:
multi= new TMultiGraph(“myMulti”,“myMulti”) ;
gDirectory->GetList()->Add(multi);
//
//
gDirectory->ls();
Produces the output.
TROOT* Rint The ROOT of EVERYTHING
TLegend X1= 0.400000 Y1=0.500000 X2=0.600000 Y2=0.700000 myLegend
OBJ: TMultiGraph myMulti myMulti : 0 at: 0x8978f08
Note teh missing "OBJ: " in front of TLegend.
Getting the TLegend back from the directory is not possible to me:
gDirectory->FindObject(“myLegend”)
Produces:
(const class TObject*)0x0
Please tell me how to store a TLegend properly in a directory,
Cheers,
J.