XRC Starting Points

Starting points for code based on a GUI specified in XML.

General Purpose

   1 import wx
   2 from wx import xrc
   3 
   4 GUI_FILENAME = "gui.xrc"
   5 GUI_MAINFRAME_NAME = "Demonstration"
   6 
   7 class MyApp(wx.App):
   8     def OnInit(self):
   9         self.res = xrc.XmlResource(GUI_FILENAME)
  10         self.frame = self.res.LoadFrame(None, GUI_MAINFRAME_NAME)
  11         self.frame.Show()
  12         return True
  13 
  14 if __name__ == '__main__':
  15     # use MyApp(0) if you don't want to redirect stdout/stderr
  16     app = MyApp()
  17     app.MainLoop()

See Also

XrcCheatSheet, UsingXmlResources, TwoStageCreation

XrcStartingPoints (last edited 2008-03-11 10:50:17 by localhost)

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.