Re: [ROOT] pointer to subpads

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Nov 25 2002 - 21:22:24 MET


Hi Michael,

To access a subpad of a pad, eg subpad 4 of pad with name "p1", do:
  TPad *subpad = (TPad*)pad->GetPrimitive("p1_4");

To access a subpad N of a pad in general, you can do (eg in a loop):
  TPad *subpad=(TPad*)pad->GetPrimitive(Form(%s_%d",pad->GetName(),N));

In the development version in CVS, I have added a new function
   TVirtualPad  *TVirtualPad::GetPad(Int_t subpadnumber);
such that you can do
   TPad *subpad = pad->GetPad(N);

I have also removed the obsolete TCanvas::GetPadDivision.

Rene Brun


On Mon, 25 Nov 2002, Michael Wiesmann wrote:

> Dear Rooters!
> 
> 
> I wanted to get a pointer to a subpad in a canvas. I was happy to find
> the function TCanvas::GetPadDivision(int, int). But it looks like that
> this function is not yet implemented in my root version 3.00/06.
> 
> 
> 
>  void *TCanvas::GetPadDivision(Int_t, Int_t)
> {
> //*-*-*-*-*-*-*-*-*Return pad corresponding to one canvas division*-*-*-*-*
> //*-*              ===============================================
> return 0;
> }
> 
> 
> Is there a more direct way than to cd(1) to the subpad and ask for
> gPad?
> 
> Thanks,
> Michael
> 
> 
> 
> 



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