Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call findClicked? #167

Open
ericu opened this issue Aug 3, 2020 · 0 comments
Open

How to call findClicked? #167

ericu opened this issue Aug 3, 2020 · 0 comments

Comments

@ericu
Copy link
Contributor

ericu commented Aug 3, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant