Re: How to Clone a Pad into another Canvas?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jan 26 1998 - 14:06:43 MET


Dirk Meier wrote:

> Hi,
>
> I have a Canvas devided into several pads and
> would like to create a second canvas which shows
> only one pad of the first canvas.
> I tried with the Clone() and DrawClone() commands,
> but they create a clone in the first canvas.
>
> How can I copy/clone into the second one?
>
> Dirk

 Suppose your canvas c1 is divided into pads p1,p2,p3,p4.
To make a copy of pad p3 in a new canvas c2, you can do:
     TPad *pnew = p3.Clone();                        //makes a copy of
p3
     TCanvas *c2 = new TCanvas("c2");   //creates new canvas
     pnew->Draw();                                        //draw pnew
into c2

Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:29 MET