Code Starting Points

All code has to begin somewhere, but it can be something of a drag pulling out the old notes and starting up.

Also, I've noticed that there are different ways to start a wxPython program, some very interesting and original.

Fill this in as you like; I'm working with XRC right now, so I've written XrcStartingPoints.

-- LionKimbro 2003-09-17 22:02:12

Single Frame, Sizer

   1 import wx
   2 
   3 FRAME_TITLE = "Demo"
   4 FRAME_SIZE  = (300,200)
   5 
   6 class AppFrame(wx.Frame):
   7     def __init__(self):
   8         wxFrame.__init__( self,
   9                           None, -1, FRAME_TITLE,
  10                           size=FRAME_SIZE,
  11                           style=wx.DEFAULT_FRAME_STYLE )
  12         self.sizer = wxBoxSizer( wx.VERTICAL )
  13 
  14         # put stuff into sizer
  15 
  16         # apply sizer
  17         self.SetSizer(self.sizer)
  18         self.SetAutoLayout(1)
  19         self.Show(1)
  20 
  21 app = wx.PySimpleApp()
  22 frame = AppFrame()
  23 app.MainLoop()

CodeStartingPoints (last edited 2008-03-11 10:50:20 by localhost)

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