> def __init__(self, parent):
> self._init_ctrls(parent)
> exitID = wxNewId()
> aTable = wxAcceleratorTable([(wxACCEL_CTRL, ord('Q'), exitID)])
> self.SetAcceleratorTable(aTable)
You are inheriting from wxFrame, but not initialising the base class -
could that be your problem?
Well, I created the test app with boa. Look in self._init_ctrl(),
the base class is initialized, there.
Here is another stripped down version to play with.
It should close on Ctrl-Q and ALT-X, but only ALT-F4 works.
Robin?
#!/usr/bin/env python
from wxPython.wx import *
class wxFrame1(wxFrame):
def __init__(self, parent):
wxFrame.__init__(self, parent, -1, title = 'testFrame',
style = wxDEFAULT_FRAME_STYLE)
exitID = wxNewId()
aTable = wxAcceleratorTable([(wxACCEL_CTRL, ord('Q'), exitID),
(wxACCEL_ALT, ord('X'), exitID)])
self.SetAcceleratorTable(aTable)
class BoaApp(wxApp):
def OnInit(self):
self.main = wxFrame1(None)
self.main.Show(true)
self.SetTopWindow(self.main)
return true
def main():
application = BoaApp(0)
application.MainLoop()
if __name__ == '__main__':
main()
For me, the solution I posted works flawless.
I can't see any logical difference in wxAcceleratorTable. Do you?
Horst
Cheers,
Hans-Peter
···
On Monday, 4. March 2002 03:03, Horst Herb wrote:
On Mon, 4 Mar 2002 10:48, Hans-Peter Jansen wrote: