[fxruby-users] FXScrollArea messages
Lyle Johnson
lyle at knology.net
Wed May 18 22:14:38 EDT 2005
On May 16, 2005, at 1:02 PM, Jannis Pohlmann wrote:
> I've got a few problems getting a subclass of FXScrollArea react on
> SEL_MOTION and SEL_LEFTBUTTONPRESS.
>
> In the constructor I wrote
>
> FXMAPFUNC(SEL_MOTION, 0, "onMouseMove")
> FXMAPFUNC(SEL_LEFTBUTTONPRESS, 0, "onLeftClick")
>
> I also tried
>
> self.connect(SEL_MOTION, method(:onMouseMove))
> self.connect(SEL_LEFTBUTTONPRESS, method(:onLeftClick))
>
> But when I use this widget those handler functions are never called,
> even
> if I call .setFocus on it.
Could you send me some sample code that demonstrates the problem? The
first approach that you mentioned is the right idea, although there may
be some piece missing in the bridge from FOX to FXRuby.
The second example definitely wouldn't work, because FXScrollArea
doesn't forward those messages to its message target, and that's what
connect() is all about: setting up a map the messages that a widget
sends to its message target, and some chunk of code to handle that
message.
More information about the fxruby-users
mailing list