Hi, I have a FXImageFrame widget and I would like it to show another image when I click on it. I''m having no luck with receiving a onclick via SEL_LEFTBUTTONRELEASE. ... imageframe=FXImageFrame.new(mainwindow,the_image,LAYOUT_EXPLICIT,0,0,20,20) imageframe.connect(SEL_LEFTBUTTONRELEASE) {p ''onclick received''} ... What is it that I''m missing? Thanks in advance, Mathijs. -- View this message in context: http://www.nabble.com/FXImageFrame-SEL_LEFTBUTTONRELEASE-tp16286969p16286969.html Sent from the FXRuby Users mailing list archive at Nabble.com.
On Mar 25, 2008, at 2:46 PM, Mathijs C wrote:> I have a FXImageFrame widget and I would like it to show another > image when > I click on it. > > I''m having no luck with receiving a onclick via SEL_LEFTBUTTONRELEASE. > > ... > > imageframe=FXImageFrame.new(mainwindow,the_image,LAYOUT_EXPLICIT, > 0,0,20,20) > imageframe.connect(SEL_LEFTBUTTONRELEASE) {p ''onclick received''} > ... > > What is it that I''m missing?Sorry for the delayed response; I didn''t notice your message when it first came across the list. All that''s missing is that you need to call enable() on the imageframe before it will start sending out messages: imageframe.enable By default, some widgets (like FXLabel, or FXImageFrame) don''t forward their messages to their targets. Hope this helps, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available as a Beta book from the Pragmatic Bookshelf http://www.pragprog.com/titles/fxruby
Lyle Johnson-4 wrote:> > > imageframe.enable > > By default, some widgets (like FXLabel, or FXImageFrame) don''t forward > their messages to their targets. > > Hope this helps, >That surely helped! Thanks. -- View this message in context: http://www.nabble.com/FXImageFrame-SEL_LEFTBUTTONRELEASE-tp16286969p16553056.html Sent from the FXRuby Users mailing list archive at Nabble.com.