Added standard keyboard shortcuts for closing windows
This commit is contained in:
@@ -248,6 +248,13 @@ class AttackWindow(wx.Frame):
|
||||
# reasons.
|
||||
self.fit = False
|
||||
|
||||
aTable = wx.AcceleratorTable([
|
||||
(wx.ACCEL_CTRL, ord('W'), wx.ID_CLOSE),
|
||||
(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, wx.ID_CLOSE),
|
||||
])
|
||||
self.SetAcceleratorTable(aTable)
|
||||
self.Bind(wx.EVT_CLOSE, self.onCloseWindow)
|
||||
self.Bind(wx.EVT_MENU, self.onCloseWindow, id=wx.ID_CLOSE)
|
||||
self.CreateInteriorWindowComponents()
|
||||
|
||||
Icon.ScytherIcon(self)
|
||||
@@ -326,5 +333,8 @@ class AttackWindow(wx.Frame):
|
||||
self.update(True)
|
||||
self.Refresh()
|
||||
|
||||
def onCloseWindow(self,evt):
|
||||
self.Destroy()
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# vim: set ts=4 sw=4 et list lcs=tab\:>-:
|
||||
|
||||
Reference in New Issue
Block a user