<@U7TUBH6MS> As far as i know, there is no such th...
# tornadofx
i
@Sergio Casero As far as i know, there is no such thing as an explicit "on item click listener" What I have been doing so far, which worked quite well, is the following:
s
Thanks! will take a look
i
This ofc only works if the selected item is the one clicked - but as clicking does select the item,... you know. at least it has worked for me so far. If someone knows a better solution I'd love to hear about it 😉
actually i have mostly tried it with contextmenu, not left mouse click. let me know how it works for you
s
In my case, I want to display modal dialog with extra info for the item
It's literally my first day with tornado
hahaha
i
I hope its fun for you and you get results quickly and painlessly ;D
e
Most controls that support clicks have an action callback, and item controls have onUserSelect callback. You only need to call setOnMouseClick for UI elements that doesn’t support clicks as a part of the control contract if you will.
👍 2
🔝 1
i
@Sergio Casero I just noticed I had a mistake there. its supposed to be "selectedItem" - I had selectedProject in there (which only existed locally in my code at that point ...)
s
Ok!
@iari I hope too, I'm using it in a MPP 🙂
e
The
onUserSelect
callback actually passes in the selected item as well, so the code becomes much cleaner. If you find a control that could benefit from
onUserSelect
well add it