Hi,
Here's a simple example to show a resize function's
behavior that I don't understand.
class MyGroup : public Fl_Group
{
Fl_Box *box1;
public:
MyGroup(int x, int y, int w, int h, const char *l=0)
: Fl_Group(x, y, w, h, l)
{
box(FL_FLAT_BOX);//main widget
color((Fl_Color) FL_GRAY);
begin();
box1 = new Fl_Box(5,5,100, 100);//child widget
box1->box(FL_FLAT_BOX);
box1->color((Fl_Color) FL_RED);
end();
}
//called by the parent widget (the main window)
//when it resized
void myResize(int x, int y)
{
resize(x+5, y+5, 100, 100);//resize the main widget
box1->resize(x+5, y+5, 100, 100);//resize the child widget
}
};
The thing I want to do is to keep the main widget (in gray) at the same size
than the red box child widget when the parent widget is resized.
So if I place the resize function at the begining as in the example, I'll get
what I want.
But if I place it at the end
void myResize(int x, int y)
{
box1->resize(x+5, y+5, 100, 100);
resize(x+5, y+5, 100, 100);
}
the main widget is still well placed and resized, but the size and position of
the red box child widget don't correspond with the resize function's arguments.
What exactely happens during the call of the resize function ?
Is there a way to get the same size and position for the main widget
and the red box child widget in calling resize at the end of the myResize
function ?
Thanks
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk