import wx import wx.lib.agw.shortcuteditor as SE class MyFrame(wx.Frame): def __init__(self, parent): wx.Frame.__init(self, parent, -1, "ShortcutEditor Demo") bar = wx.MenuBar() menu = wx.Menu() menu.Append(101, "&Mercury", "This the text in the Statusbar") menu.Append(102, "&Venus", "") menu.Append(103, "&Earth", "You may select Earth too") menu.AppendSeparator() menu.Append(104, "&Close", "Close this frame") bar.Append(menu, 'File') self.SetMenuBar(bar) dlg = SE.ShortcutEditor(self) dlg.FromMenuBar(self) if dlg.ShowModal() == wx.ID_OK: # Changes accepted, send back the new shortcuts to the TLW wx.MenuBar dlg.ToMenuBar(self) dlg.Destroy() # our normal wxApp-derived class, as usual app = wx.PySimpleApp() frame = MyFrame(None) app.SetTopWindow(frame) frame.Show() app.MainLoop()