Re: [MOD] STR #3030: resize behavior of widgets in an Fl_Tree
Albrecht Schlosser
11:56 Apr 07
DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR Pending]
Link: https://www.fltk.org/str.php?L3030
Version: 1.3-current
Assigned To: greg.ercolano
Fixed in master (1.5.0).
commit 1377c60100f6adfbb8ac72701afcb58e0533df13
Date: Tue Apr 7 20:29:42 2026 +0200
Fl_Tree: make automatic resizing of children optional (STR 3030)
- add getter and setter methods:
- int Fl_Tree::auto_resize_children()
- void Fl_Tree::auto_resize_children(int mode)
Note: the default in 1.5.0 is "OFF", i.e. no automatic resizing.
The methods above can be used to switch it on if required.
This is a behavioral change to fix a bug in 1.4 and lower. It will not
be backported because it would break the ABI.
--- end of commit log ---
I chose this approach because:
(a) the resizing behavior of children was not documented [1]
(b) the current behavior led to unexpected and unpredictable results
(c) an option to select the behavior by the user of the library is useful
anyway.
Basically there's still room for improvement by defining another `mode`
value for the
`auto_resize_children(int mode)` method but that's OT here.
@Greg: I'll post another test program here that can be used to show the
effects of
auto resizing better. The default value is disputable, but I believe that
disabling
the resizing behavior is the better choice. IMHO container widgets like
Fl_Tree
should define and document their specific resizing behavior and not rely
on
Fl_Group::resize(). But I'm open for discussion on the usual channels
(fltk.development or GitHub Discussions). I'm closing this STR now.
-----
[1] docs about resizing still to be done.
Link: https://www.fltk.org/str.php?L3030
Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.