Joey Kinsella
2009-Dec-24 15:00 UTC
[fxruby-users] handling both SEL_LEFTBUTTON[PRESS|RELEASE], and SEL_DOUBLECLICK
Hello all, Does anyone know if it is possible to connect to both a SEL_LEFTBUTTONPRESS (SEL_BUTTONRELEASE), and still be able to connect to a SEL_DOUBLECLICK? I am using an FXIconList, and I''ve implemented a basic pseudo `drag-n-drop'', kind of thing... using SEL_LEFTBUTTONPRESS, and SEL_LEFTBUTTONRELEASE. I want to also handle a SEL_DOUBLECLICK so that a dialog will popup when they double click on an item. However, it appears that since I am already connecting to SEL_BUTTONPRESS/RELEASE that SEL_DOUBLECLICK is never getting triggered. (or atleast that is my assumption.) Is there a way around this? Or do I have to some how implement my own kind of SEL_DOUBLECLICK based on the FXEvent structure that is passed to SEL_LEFTBUTTONPRESS? (ie: if(data.click_count == 2) ; do_this() ; else ; do_that() ; end) I feel like that is rather hackish, and I''d rather not, if I don''t have to. Thanks, Joey -- If you are not the intended recipient, you are hereby notified that any dissemination, distribution, copying or other use of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20091224/4dfd3278/attachment.html>
Lyle Johnson
2009-Dec-29 17:08 UTC
[fxruby-users] handling both SEL_LEFTBUTTON[PRESS|RELEASE], and SEL_DOUBLECLICK
On Thu, Dec 24, 2009 at 9:00 AM, Joey Kinsella <jkinsella at ancillaryservices.com> wrote:> Does anyone know if it is possible to connect to both a > SEL_LEFTBUTTONPRESS (SEL_BUTTONRELEASE), and still be able to connect to a > SEL_DOUBLECLICK? I am using an FXIconList, and I''ve implemented a basic > pseudo `drag-n-drop'', kind of thing... using SEL_LEFTBUTTONPRESS, and > SEL_LEFTBUTTONRELEASE. I want to also handle a SEL_DOUBLECLICK so that a > dialog will popup when they double click on an item. However, it appears > that since I am already connecting to SEL_BUTTONPRESS/RELEASE that > SEL_DOUBLECLICK is never getting triggered. (or atleast that is my > assumption.) Is there a way around this? Or do I have to some how implement > my own kind of SEL_DOUBLECLICK based on the FXEvent structure that is passed > to SEL_LEFTBUTTONPRESS? (ie: if(data.click_count == 2) ; do_this() ; else ; > do_that() ; end) I feel like that is rather hackish, and I''d rather not, if > I don''t have to.The default SEL_LEFTBUTTONRELEASE handler for the FXIconList is where a SEL_DOUBLECLICKED message is usually generated, and (as you supposed), it''s checking the FXEvent struct to see what the click count is. You might be able to get this to work by ensuring that your SEL_LEFTBUTTONRELEASE handler evaluates to false, e.g. iconList.connect(SEL_LEFTBUTTONRELEASE) do # ... something ... false end This will cause the default SEL_LEFTBUTTONRELEASE handler to pick up where you left off. Hope this helps, Lyle