trouble with tree: vanishing cursor and focus problems
"lifeatt...
May 21, 2021
FLTK 1.4, not too old; Linux MATE 20.1; gcc 9.3.0.
A small program derived from the tree-as-container example. Instead of using Fl_Tree_Item widgets, I'm drawing them dynamically. A Fl_Tree_Item consists of a checkbox and a label, except if the item is in "edit mode", when it is a checkbox and a Fl_Input. To enter "edit mode", the tree item must be RE-selected.
The problem: when I try to edit an existing tree item, the mouse cursor disappears over the window. After that, only keyboard navigation works in the tree, and I can't seem to RE-select an item any longer [assuming that hitting space twice on an item should RE-select it].
I've been thrashing on this for a bit, and would appreciate some ideas on what I've done wrong.
I'm attaching my stripped down program. To reproduce the issue, do the following:
1. run the program
2. Make sure the item "Outline" is selected. [shows in green]
3. Press enter. A new item is created: a Fl_Input appears, enter some text. Press enter.
4. The new item should be highlighted in green at this point. Repeat step 3 a couple of times. You should have three tree child items with text.
5. With the mouse, click on the 2d item to select it, then click again to RE-select it.
6. The Fl_input appears: start typing some text.
As soon as I start typing text at step 6, the mouse disappears. Pressing enter to finish editing doesn't restore the mouse; up and down arrow work to move the selection focus among the tree items but pressing space twice on a focused item doesn't RE-select it.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.