Re: [ROOT] Problem with TGMatrixLayout and other questions

From: Ilka Antcheva (Ilka.Antcheva@cern.ch)
Date: Tue Aug 26 2003 - 09:59:44 MEST


Hi Ed,

See the notes below:

Edward Chen wrote:

> Hi - I'm having a problem with TGMatrixLayout (in 3.04/02):
>
>    fMain   = new TGMainFrame(p, w, h);
>    //   fMain->SetLayoutManager(new TGHorizontalLayout(fMain));
>    fMain->SetLayoutManager(new TGMatrixLayout(fMain,0,2,10));
>
>    fF6 = new TGGroupFrame(fMain, "Cut options", kVerticalFrame);
>    fMain->AddFrame(fF6);
>    fF6->SetLayoutManager(new TGMatrixLayout(fF6, 0, 5, 10));
>    ...
>    fF7 = new TGGroupFrame(fMain, "Actions", kVerticalFrame);
>    fMain->AddFrame(fF7);
>    ...
>
> Using TGHorizontalLayout for fMain, I get both frames fF6 and fF7.
> However, switching to the TGMatrixLayout, I get only get fF6.

You need to call Resize() method after adding what you want into a group
frame, i.e.:
       fF7->Resize();

> Another question is - for fF6, when I specify kVerticalFrame in the
> constructor, is that really necessary given that I use a MatrixLayout?

You need MatrixLayout if you want to have frames arranged in a matrix
way:
(rows x columns). Specifying kVerticalFrame in the constructor you will
get a
one column vertical layout.

> Also - is there a relatively simple way to set up a frame with three
> frames inside such that it looks like:
>
> [][]
> [  ]
>
> without grouping the top two together?

The only way I know is to have a horizontal frame to group and layout the
two
top frames; and after to layout this frame vertically with the bottom
one.

>
> Thanks for any help.
>
> -Ed

Best regards, Ilka



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