|
|
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: https://www.fltk.org/str.php?L2639
Version: 1.4-feature
I tested Fl_Flex in the given context by modifying the first demo program
https://www.fltk.org/strfiles/2639/rsz.cc and replacing Fl_Pack with
Fl_Flex. Fl_Flex needs some layout hints if you want only one flexible
(i.e. resizable) widget (usually all children are flexible). See uploaded
file https://www.fltk.org/strfiles/2639/str2639_rsz_flex.cxx . Setting the
layout is done like this:
// Fl_Flex p1: set layout and end group
p1->fixed(g1, 30);
p1->fixed(g2, 30);
p1->fixed(b1, 30);
p1->fixed(b2, 30);
p1->end();
// p1->resizable(g3); // would be ignored by Fl_Flex
I also added a size_range():
window->size_range(200, 60);
Using 60 lets you resize the window to a minimal height of 60 which hides
all groups behind the buttons, but resizing works as designed. Hiding and
showing the group g2 works as expected. :-)
IMHO Fl_Flex is superior to Fl_Pack in many ways and can replace Fl_Pack in
cases where Fl_Pack doesn't work well by design. An even more flexible
widget Fl_Grid will be added to FLTK 1.4.0 soon.
Link: https://www.fltk.org/str.php?L2639
Version: 1.4-feature
[ Direct Link to Message ] | |
|
| |