David Lopez wrote:
> Hi, I'm sorry to disturb you with a so basic question.
> The posted source code implements a rough button moving by drag and drop in a
> resizable window.
> If I move the button and then I maximize or resize the window, the buttton is
> moved and scaled as expected.
> But if I first maximize the window and and then I move the button and after
> that I restore the window size, the button appears on its original location.
> What am I missing? How can I preserve the changes done during the maximized
> state?
I'm not sure if this is the problem, but the thing to remember
about Fl_Window is it derives from Fl_Group, which means
by default child widgets get resized when the group changes size.
(And the group changes size when the window changes size).
This resize behavior is defined in Fl_Group's resize() method
IIRC, which you can override by deriving a class from Fl_Window
and defining your own resize() method that can just skip all that
resize logic.
Maybe what you want is to put your movable button in an Fl_Scroll.
Fl_Scroll isolates its child widgets from any resize behavior,
since the purpose of the scroll is to act as a resizable window
onto the children, where the children remain a fixed size, and
the 'window view' is the only thing that changes size, where
scrollbars appear when the window is too small.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk