Hot Door CORE Forum
setDoubleClickCallback not working for label widgets - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: Bugs (http://hotdoorcore.com/forum/forumdisplay.php?fid=5)
+--- Thread: setDoubleClickCallback not working for label widgets (/showthread.php?tid=239)



setDoubleClickCallback not working for label widgets - Rick Johnson - 08-27-2020

I'm trying to set a double-click callback for a Label widget, but it doesn't get called. Mine contains an image, but the behavior can be easily reproduced in the panel sample project. Add these lines to the document name label definition:


Code:
this->__docPanelNameLabel.setDoubleClickCallback(HDI_CORE_CALLBACK(panel::Plugin, this, __doubleclickTestCB));
this->__docPanelNameLabel.setClickCallback(HDI_CORE_CALLBACK(panel::Plugin, this, __clickTestCB));

Now add these two callbacks containing any do-nothing code:

Code:
void panel::Plugin::__doubleclickTestCB(){
int i = 0;
}
void panel::Plugin::__clickTestCB(){
int i = 0;
}

Add breakpoints to each callback, run and test by clicking and double-clicking the label. Double-click never gets called, but instead calls the click callback twice. I tried this on a Button widget with the same results.

Is there something else that needs to be set to recognize a double click?

Thanks for any advice.