Re: AW: [Fxruby-users] where can i look up a list of all possible events?
Status: Inactive
Brought to you by:
lyle
|
From: Lyle J. <jl...@cf...> - 2003-07-29 12:56:12
|
Recheis Meinrad wrote:
> i managed to catch the mousewheelevent of the FXGLCanvas.
> i get the sender, selector and data.
>
> how is the selector to be interpreted?
According to the documentation here:
http://www.fxruby.org/doc/api/classes/Fox/FXWindow.html
the message data for a SEL_MOUSEWHEEL message is an FXEvent object. If
you're getting a 'nil' value for the message data, you must be using a
very old version of FXRuby (this bug was fixed in FXRuby version 1.0.19).
At any rate, your handler for a SEL_MOUSEWHEEL message from the
FXGLCanvas should look something like this:
canvas = FXGLCanvas.new(...)
canvas.connect(SEL_MOUSEWHEEL) { |sender, sel, evt|
delta = evt.code/120
}
The 'code' attribute of the FXEvent instance for SEL_MOUSEWHEEL messages
should contain some integer value that is a multiple of 120. The code
may be positive (for spinning "up") or negative (for spinning "down").
Hope this helps,
Lyle
|