Re: [ROOT] unable to combine 2 canvases with sub-pads to make a composite

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu May 15 2003 - 14:13:44 MEST


Hi Simon,

Thank for reporting this problem with TCanvas::DrawClonePad.
It happens when the source pad has itself subpads.
I have fixed the problem in the CVS version.

Rene Brun

Simon Blyth wrote:
> 
> {
>    /*
>        Dear All,
> 
>        attempting to combine 2 canvases to make a 3rd
>        which is a composite of the 2 -- doesnt work
>        with ROOT Version   3.04/02     10 March 2003
>        on RedHat 8.0
> 
>        the c2 canvas expands to fill the full c3 canvas,
>        ... how do I pursuade it to reside in its pad  ?
> 
>        Yours,  Simon
> 
>     */
> 
>    TLine l1(0,0,1,1);
>    TLine l2(1,0,0,1);
> 
>     c1 = new TCanvas("c1","c1",200,200,200,200);
>     c2 = new TCanvas("c2","c2",400,200,200,200);
> 
>    c1->Divide(2,2,0,0);
>    for( Int_t i=1 ; i<=4 ; ++i ){
>      c1->TPad::cd(i);   //
>      l1.Draw();
>      gPad->Modified(); gPad->Update() ;
>    }
>    c1->Modified(); c1->Update();
> 
>    c2->Divide(2,2,0,0);
>    for( Int_t i=1 ; i<=4 ; ++i ){
>      c2->TPad::cd(i);   //
>      l2.Draw();
>      gPad->Modified(); gPad->Update() ;
>    }
>    c2->Modified(); c2->Update();
> 
> /*
>    these make no difference, as do trying to fix aspect ratio, fixing
>    sizes etc...
> 
>    c1->SetFillStyle(4000);
>    c2->SetFillStyle(4000);
>    c1->SetEditable(kFALSE);
>    c2->SetEditable(kFALSE);
>  */
> 
>    c3 = new TCanvas("c3","c3",600,200,400,200);
>    c3->TPad::Divide(2,1,0,0);
>    c3->Modified();
>    c3->Update();
> 
>    c3->cd(1);
>    c1->DrawClonePad();
> 
>    c3->cd(2);
>    c2->DrawClonePad();
> 
>   /*
>    delete c2 ;
>    delete c1 ;
>   */
> 
> }



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET