[fxruby-users] extending keystroke response in FXOptionMenu

Ned Konz ned at productcreationstudio.com
Thu Aug 5 17:44:58 EDT 2010

I've just started working with FXRuby, and it looks to be quite useful.

However, it's not clear to me how to go about extending the behavior of
(say) a FXOptionMenu so that it responds to (say) Enter keystrokes in
the same way that it responds to Space keystrokes.

It looks like there might in general be two ways to handle this:

* subclass FXOptionMenu (and maybe FXOption as well) and override its
existing onKeyPress and onKeyRelease methods, or

* use connect() to provide new blocks for SEL_KEYPRESS.0 and
SEL_KEYRELEASE.0 for one or both of FXOptionMenu and FXOption

As far as I can tell, doing either requires a reference to the fox
sources, as far as I can tell, to see the existing FXDEFMAP/FXMAPFUNC
commands and handlers.

Is this a standard way to use fxruby (that is, with the sources for the
Fox libraries at hand)?

Or is there a simpler way that people who actually know what they're
doing would use?

Ned Konz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100805/8f054d20/attachment.html>

More information about the fxruby-users mailing list