Re: [fltk.general] Fl_Tree events

2012-05-18 Thread Eugenio Bargiacchi
Thanks! I missed the find_clicked() method, so I thought it would be more complicated than that to add event checking for that. Also thank you for the code example, it'll help me speed up the creation of what I need =) On 05/17/12 20:27, Greg Ercolano wrote: On 05/17/12 11:56, Eugenio

[fltk.general] Fl_Tree events

2012-05-17 Thread Eugenio Bargiacchi
I'm trying to intercept right click events on a Fl_Tree, and do different actions depending on the Fl_Tree_Item selected this way. I've noticed that in the handle code of Fl_Tree a right click sets the corresponding Fl_Tree_Item as the local focus, but does not select it nor triggers a

Re: [fltk.general] Fl_Tree events

2012-05-17 Thread Greg Ercolano
On 05/17/12 09:44, Eugenio Bargiacchi wrote: The problem is even if I were to reimplement handle() and make it trigger a callback, there would be no obvious way for me to get the focused item, since the pointer that holds that is private It looks like the Fl_Tree API has a public

Re: [fltk.general] Fl_Tree events

2012-05-17 Thread Eugenio Bargiacchi
get_item_focus() would certainly help. If I may suggest, you could also add FL_TREE_REASON_FOCUS_SELECTED and FL_TREE_REASON_FOCUS_DESELECTED as fields in the Fl_Tree_Reason enum, if the focus changed but the selected item did not. And maybe a couple of methods to setup which key/click

Re: [fltk.general] Fl_Tree events

2012-05-17 Thread Greg Ercolano
On 05/17/12 11:56, Eugenio Bargiacchi wrote: get_item_focus() would certainly help. Try implementing it and see if it does. I'll certainly add it anyway, as it seems to be an omission. If I may suggest, you could also add FL_TREE_REASON_FOCUS_SELECTED and