""" Mini-app for testing the KeyConfigDialog! """ import wx import KeyConfigDialog import Config class TestKeyConfigApp(wx.App): def __init__(self, *args, **kw): self.App = self self.Config = Config.NecroConfig() wx.App.__init__(self, 0, *args, **kw) def OnInit(self): print ">>>>>>OnInit() called!" self.BuildWidgets() self.keepGoing = True self.ShowDialog() return True def BuildWidgets(self): print "Building widgets..." self.Frame = wx.Frame(None, -1, "Test") def ShowDialog(self): Dialog = KeyConfigDialog.KeyConfigDialog(self.Config.KeyConfig, self.Frame, -1, "Key config", size = (300, 500), style = wx.DEFAULT_DIALOG_STYLE) Dialog.CenterOnScreen() # this does not return until the dialog is closed. ReturnValue = Dialog.ShowModal() if __name__ == "__main__": App = TestKeyConfigApp() App.MainLoop()