Re: Fixed size TPad/TCanvas

Onuchin Valeriy (onuchin@sirius.ihep.su)
Wed, 21 Jul 1999 13:27:05 +0400


Laurent Aphecetche wrote:

>
> I'm afraid this only works with top level windows.
> What I have is a TRootEmbeddedCanvas with some TPad in it. I would like
> both the TCanvas from
> the TRootEmbeddedCanvas AND the TPad inside to be of fixed size.
>
> --

Hi Laurent!

suppose it could be done by

TRootEmbeddedCanvas* mycanvas;

mycanvas->GetCanvas()->SetEditable(kIsNotEditable); // to prevent pads
to be resized
mycanvas->ChangeOptions(mycanvas->GetOptions() | kFixedWidth |
kFixedHeight );

//if it is not enough try

TGFrame* cont = mycanvas->GetContainer();
cont->ChangeOptions(cont->GetOptions() | kFixedWidth | kFixedHeight );

TGFrame* view = mycanvas->GetViewPort();
view->ChangeOptions(view->GetOptions() | kFixedWidth | kFixedHeight );


Best regards, Valery