imm wrote:

> On 5 Oct 2007, at 18:21, Alvin wrote:
> 
>> How can I make an Fl_Tile automatically resize its and its children
>> when the
>> Fl_Double_Window (its parent) resizes?
>>
>> Inside the Fl_Tile, I have two other widgets stacked vertically.
>> When the
>> apps appears, I can move the divider between the two widgets.
>> However, when
>> I resize the app, the Fl_Tile doesn't grow.
> 
> Does this not "Just Work"? I'm probably missing the point of what you
> are trying to do...
> Anyway, here's a "worked example" cut down from tile.cxx that seems
> to do what I think you are asking.
> 
> ------------------
> #include <FL/Fl.H>
> #include <FL/Fl_Double_Window.H>
> #include <FL/Fl_Tile.H>
> #include <FL/Fl_Box.H>
> 
> int main(int argc, char** argv)
> {
>    Fl_Window window(320, 320);
>      Fl_Tile tile(10, 10, 300, 300);
>        Fl_Box upper_box(10, 10, 300, 150, "upper");
>        upper_box.box(FL_DOWN_BOX);
>        upper_box.color(9);
>        upper_box.labelsize(36);
>        upper_box.align(FL_ALIGN_CLIP);
> 
>        Fl_Box lower_box(10, 160, 300, 150, "lower");
>        lower_box.box(FL_DOWN_BOX);
>        lower_box.color(12);
>        lower_box.labelsize(36);
>        lower_box.align(FL_ALIGN_CLIP);
>      tile.end();
>    window.end();
>    window.resizable(tile);
>    window.show(argc,argv);
>    return Fl::run();
> }
> 
> /* end of file */

I guess it may have something to do with the main Fl_Double_Window layout
that I have. I have a several Fl_Group widgets and one Fl_Tile. The Fl_Tile
is not set to be resizable. I have the resizable widget set to the Fl_Group
that is the same height and to the left of the Fl_Tile. When I resize the
Fl_Double_Window all the groups grow according to how the left group grows.
The Fl_Tile appears not to grow. However, I can see from the printf
statements in the Fl_MyTile (initial post) that it was in fact growing.

The issue for me was that the children of the Fl_Tile were not growing along
with the Fl_Tile. The Fl_Vertical_Tile that I posted attempts to resize the
last child widget so that it consumes the new free space.

I will need to review the tile example and do some more testing. I have a
feeling that this is a design issue on my part. I may not be using the
Fl_Tile correctly.

Cheers,

-- 
Alvin
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to