Don't know where my yesterday's post ended, so here it is again.
Sorry for the incenvenience, if any.
Davor
The original message follows:
Can I use EVT_KEY_DOWN with wxDialogs (or wxFrames or wxWindows)? It seems
that I cannot.
Here's a little example:
,----[ /home/davor/python/keydown.py ]
from wxPython.wx import *
class MainWindow(wxFrame):
def __init__(self, parent, id, title):
wxFrame.__init__(self, parent, -4, title, size = (200, 100),
style = wxDEFAULT_FRAME_STYLE)
self.control = wxTextCtrl(self, 1, style = wxTE_MULTILINE)
EVT_KEY_DOWN(self, self.OnKeyDown)
self.Show(True)def OnKeyDown(self, event):
print "Some key pressed, still don't know which one"app = wxPySimpleApp()
frame = MainWindow(None, -1, "KeyDownTest")
app.MainLoop()
`----
Simple window is shown, but self.OnKeyDown is never called. If I attach
self.control to EVT_KEY_DOWN it works ("Some key pressed..." message is
displayed and no text is shown in the wxTextCtlr, but that doesn't bother
me).
Basically, I want to close a window/dialog on ESC. E.g. About program
dialog, or Config dialog.
Thanks.
···
--
davor.cengija@mail.inet.hr