[fxruby-users] Need help getting ALT+F4 hotkey to work

Paul Carvalho tester.paul at gmail.com
Wed Mar 31 01:13:03 EDT 2010

Hi there, quick question.  I am trying to make my app aware of the ALT+F4
hot-key to quit but can't quite get the syntax correct.

My app has a method to handle the close/quit event, and I have the following

    button_quit.connect(SEL_COMMAND, method( :onCmdQuit ))
    self.connect(SEL_CLOSE, method( :onCmdQuit ))
#    self.accelTable.addAccel( fxparseAccel( "Alt+F4" ), self, method(
:onCmdQuit ) )

The first 2 lines work as expected and re-route the Quit event from either
the 'Quit' button or the [X] close button from the title bar to the shutdown
method. (good)

The 3rd line doesn't work though.  When I run the app, I get the error: "in
`addAccel': can't convert Method into Integer (TypeError)"

What am I missing?  I've tried several variations on that command to get the
hot-key to work but I've had no luck yet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100331/28f5a23e/attachment-0001.html>

More information about the fxruby-users mailing list