All pastes #1059668 Raw Edit

Migrating wxPython to Python OOP

public python v1 · immutable
#1059668 ·published 2008-07-01 04:34 UTC
rendered paste body
#first wxPython application#Start: June 30 2008#Author: Lamonte (wx-python-blog.cleanscript.com)#import wx python moduleimport wxclass FrameClass(wx.Frame):	def __init__(self, parent, id, title):		"""		create a frame widget this is the actual window that we see		initialize the frame widget init class which 		must be initialized inorder for the widget to work		"""		wx.Frame.__init__(self, parent, id, title)	#set window size	def size(self,size):		self.SetSize(size)	#show the frame widget window	def display(self):		self.Show()		#create a new application objectapplication = wx.App()#create a frame widget this is the actual window that we see with the window title of "My First Application"frame = FrameClass(None,-1,"My Second Frame Application")#set the frame sizeframe.size((400,300))#display the frameframe.display()#loop the application until the user closes the applicationaapplication.MainLoop()