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

add single click event handler to listbox #684

Open
wants to merge 1 commit into
base: develop-1.8
Choose a base branch
from

Conversation

crillion
Copy link

@crillion crillion commented Jan 2, 2024

Hi, I've recently had the necessity, in a listbox, of managing not only the double click on row items, but also the single click. So I've tried to make a simple thing : I duplicated the code for the dbl_click handler in a click handler.
I've seen that it works : it correctly reacts to single clicks. To avoid code duplication I've put the common instructions in a central, private method.
One possible issue that remains (but I've no idea on how to fix it) is that now, whenever I double click, both events get called : double click and single click. Could single click be just called with single clicks ?

@cnjinhao
Copy link
Owner

it's a little complicated. IMO, a proper way is to add a flag to indicate which handler should be invoked for listbox. The flag is a three-value flag: click/dbl_click/both

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

Successfully merging this pull request may close these issues.

None yet

2 participants