FXImageFrame/SEL_LEFTBUTTONRELEASE

View: New views
3 Messages — Rating Filter:   Alert me  

FXImageFrame/SEL_LEFTBUTTONRELEASE

by Mathijs C :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Re: FXImageFrame/SEL_LEFTBUTTONRELEASE

by Lyle Johnson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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



_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users

Re: FXImageFrame/SEL_LEFTBUTTONRELEASE

by Mathijs C :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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.
LightInTheBox - Buy quality products at wholesale price