Hi Reiner, Thanks for reporting this problem with nested pads. Now fixed in CVS. Rene Brun > > Hi ROOTteam > > In my program I want to save a pad with sub-pads into a ROOT file. But when I > read them pack the sub-pads are not sub-pads of the pad any more but are > sub-pads of the canvas. > > You can try this with the attached macros: > > root [0] .x Save.C > ROOT file: pad.root has been created > root [1] delete canvas > root [2] .x Read.C > > This did work fine with the version 2.25 but does not work any more with > version 3.00/06 > > Thanks Reiner. > > --Boundary_(ID_m98SyuSi5xYR6znyqIa9vQ) > Content-type: TEXT/plain; CHARSET=us-ascii; name=Save.C > Content-disposition: attachment; filename=Save.C > Content-description: Save.C > > { > gROOT->Reset(); > > TCanvas * canvas = new TCanvas("a", "b", 30, 30, 500, 400); > TPad * pad = new TPad("c", "d", 0.4, 0.4, 0.8, 0.8); > pad->Draw(); > > pad->Divide(2, 2); > > pad->SaveAs("pad.root"); > } > > --Boundary_(ID_m98SyuSi5xYR6znyqIa9vQ) > Content-type: TEXT/plain; CHARSET=us-ascii; name=Read.C > Content-disposition: attachment; filename=Read.C > Content-description: Read.C > > { > gROOT->Reset(); > > TCanvas * canvas = new TCanvas("e", "f", 30, 400, 500, 300); > > TFile * file = new TFile("pad.root", "READ", "no" , 1); > > TPad * pad = (TPad*)file->Get("c"); > file->Close(); > delete file; > > pad->Draw(); > > } > > --Boundary_(ID_m98SyuSi5xYR6znyqIa9vQ)-- > > ----- End forwarded message ----- > > -- > Org: CERN, European Laboratory for Particle Physics. > Mail: 1211 Geneve 23, Switzerland > E-Mail: Fons.Rademakers@cern.ch Phone: +41 22 7679248 > WWW: http://root.cern.ch/~rdm/ Fax: +41 22 7677910
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:50 MET