FLTK logo

Re: [MOD] STR #2639: Fl_Pack resizes hidden widgets, which it doesn't touch when visible.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.bugs  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [MOD] STR #2639: Fl_Pack resizes hidden widgets, which it doesn't touch when visible. Albrecht Schlosser Jan 20, 2023  
 
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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.