[...]

>   // resize the window programaticaly, after it is mapped
>   else if (argc == 1)
>   {
>      Fl::check();
>      Fl::check();
>      second->size(900,700);
>   }
>
> I believe that I tested it, but I deleted it before finishing this
> posting.

It works fine.


> Anyway, I agree with Ian that using Fl_Groups and their built-in
> resizing behavior is often easier than trying to use (maybe nested)
> Fl_Pack's. Only the *initial* sizes and positions of widgets inside
> the groups are more difficult [1] to calculate, but resizing it then
> done automatically.
>
> Albrecht
>
> [1] actually it's not difficult, just a little work to be done ;-)

Here what I have done using group for the same behavior.
What afraid me, its in the case of more complex window,
(I think of one of the Nedit window for exemple), the computation of the button 
positioning can become quickly a nightmare.
(at least Fl_Pack hide some with spacing parameters)

Or may be, I have come the wrong way using Fl_Group.

Fl_Double_Window *FirstTry(int WW, int HH) {
    Fl_Double_Window* w = new Fl_Double_Window(WW, HH, "First Group Test");

    const int border = 5;
    Fl_Box* box = new Fl_Box(border,border,WW-2*border,HH-50-border, "A Tree 
Widget" );
    box->box(FL_DOWN_BOX);
    box->color( fl_lighter( FL_GRAY ) );

    Fl_Group* g = new Fl_Group(border,border + box->h() + 
border,WW-2*border,30);
    Fl_Button* b1 = new Fl_Button( border, border + box->h() + border, 100, 30, 
"Go Up" );
    Fl_Button* b2 = new Fl_Button( b1->x() + b1->w() + border, b1->y(),100, 30, 
"Go Down" );
    Fl_Box* b = new Fl_Box(b2->x() + b2->w(), b1->y(), 1, 30 );
    b->hide();
    g->resizable( b );
    g->end();

    w->resizable(box);
    return w;
}


_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to