fltkhs icon indicating copy to clipboard operation
fltkhs copied to clipboard

How to call findClicked?

Open ericu opened this issue 4 years ago • 0 comments

The signature of findClicked [to find what item was last clicked in a tree] is:

findClicked:: (Parent a TreePrefs) => Ref TreeItem -> Ref a -> IO (Maybe (Ref TreeItem))

The FLTK function is a method on Fl_Tree [https://www.fltk.org/doc-1.3/classFl__Tree.html#a7856a0184dac252a148049fb87f67b80], so I'd expect this to take a Ref Tree, and I'm not sure what's up with the TreePrefs.

My goal is to go from right-click to a context menu for an item. I can get the last selected item, but that's not set by right-click, only left-click or keyboard. I'm doing this in a custom event handler; the callback for a tree appears to be for select/deselect events.

ericu avatar Aug 03 '20 19:08 ericu