[wxPython] esc key and wxDialog

Hi,

I m working on a login/pass protected application and have some problem with the esc key. I need the user to identify himself before using the application. I have a modal dialog with login and password entry, but i don t want it to be closed when the user hit the esc key. First i thought that the OnCancel method was called but it doesn t seem to. I tried to intercept the hit on the esc key with EVT_CHAR_HOOK, EVT_KEY_DOWN, EVT_KEY_UP and EVT_CHAR but it doesn t work.

Can some one help me ?

Thx

Pierre

···

Get your FREE download of MSN Explorer at http://explorer.msn.com

I m working on a login/pass protected application and have some
problem with the esc key. I need the user to identify himself
before using the application. I have a modal dialog with login
and password entry, but i don t want it to be closed when the
user hit the esc key.

You can try catching EVT_BUTTON for wxID_CANCEL. Otherwise you can check
the return value of ShowMOdal() and if it's wxID_CANCEL then simply show the
dialog again.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!