[fxruby-users] Handling Escape key-press in dialog window

Vladimir Konrad v.konrad at lse.ac.uk
Fri Jan 11 12:04:08 EST 2008


I am trying to do a log-in screen for an application and have a problem
with handling ESC key - when you press it, the dialog box closes and
the application opens. What I would like is to quit the application if
user hits ESC key while the initial log-in window is open.

The LoginWindow class looks like:

class LoginWindow < FXDialogBox

  def initialize(owner)
    super(owner, "gbrs - log in", :opts => DECOR_TITLE |
DECOR_BORDER, :width => 300, :height => 250)

    <paint the log-in window here>
    # the following code should do it but it does not

    self.accelTable.addAccel(fxparseAccel("ESC"), getApp(), \
# end of class

Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm

More information about the fxruby-users mailing list