On 5/21/21 9:24 AM, lifeatt...@gmail.com wrote:
FLTK 1.4, not too old; Linux MATE 20.1; gcc 9.3.0.
I think what's missing is you need to tell Fl_Tree_Item about
the widget by calling
Fl_Tree_Item::widget(_text).
The test/tree.cxx example shows how this works.
begin(); // For some reason this magic is required when adding new items
My thanks, again! I ended up with Ian's approach, partly because it felt simpler. I expect if I used the widget() approach with a group of the checkbox and fl_input, I could get that working too.
I'd caution that, whilst my workarounds frequently work, that doesn't mean they are necessarily the correct fix...
I would not recommend adding FLTK widgets to Fl_Tree without
assigning them with widget().
I wrote Fl_Tree, and I'd say any behavior you get without
doing that would be "undefined",
as the tree doesn't know which item to associate the widget
with, and therefore where or when
to draw it.