Dear Rene, thanks for the bug, but I still have the problem of getting the number of pads attached to a subpad. To be maybe more specific, I want to create a spectra viewer and make a few basic "automatic" command... one of them would be to be able to put all the spectra displayed in one canvas in a lin or log scale. By typing the command: Pads = ((TList*) MyCanvas->GetListOfPrimitives())->GetSize(); I get the number of pads attached to my canvas (at the first level) probably because no other objects than pads are attached to the canvas. Now, the problem is: when I point to a pad which contains some other objects (that's what is going to happen when the spectra will be displayed !), the command: Pads = ((TList*) gPad->GetListOfPrimitives())->GetSize(); would give me the number of objects in the pad, this includes the TPad* (if any) but also the TH1F* etc... Exemple for one histo with title and stat... but no other subpad: root [21] ((TList*) gPad->GetListOfPrimitives())->ls() TFrame X1= -3.000000 Y1=-0.301030 X2=3.000000 Y2=2.739947 OBJ: TH1F hi1 Random histo : 0 TPaveText X1= -3.675000 Y1=2.911002 X2=-1.950000 Y2=3.101063 title TPaveStats X1= 2.100000 Y1=2.435849 X2=3.600000 Y2=3.044045 stats Now for a Pad which contains 2 subpads, 2 histos etc... root [22] ((TList*) gPad->GetListOfPrimitives())->ls() TPad fXlowNDC=0.01 fYlowNDC=0.01 fWNDC=0.48 fHNDC=0.98 Name= Beta_3_1 Title= Beta_3_1 Option= TFrame X1= -3.000000 Y1=-0.301030 X2=3.000000 Y2=2.739947 OBJ: TH1F hi1 Random histo : 0 TPaveText X1= -3.655610 Y1=2.916956 X2=-1.940148 Y2=3.107686 title TPaveStats X1= 2.087458 Y1=2.440131 X2=3.579164 Y2=3.050467 stats TPad fXlowNDC=0.51 fYlowNDC=0.01 fWNDC=0.48 fHNDC=0.98 Name= Beta_3_2 Title= Beta_3_2 Option= TFrame X1= -3.000000 Y1=0.000000 X2=3.000000 Y2=322.380856 OBJ: TH1F hi1 Random histo : 0 TPaveText X1= -3.675000 Y1=340.514782 X2=-1.950000 Y2=360.663586 title TPaveStats X1= 2.100000 Y1=290.142780 X2=3.600000 Y2=354.618951 stats So, my question is: is there a method which allows me to get a "Int_t" telling me how many TPad* there is in a given Pad (0 in the first example and 2 for the second) ?
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:41 MET