ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/learning/wxpython/Script3.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
Original Path: Python/NinoCode/learning/wxpython/Script3.py
File size: 780 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 import wx
2     import sys
3     class Frame(wx.Frame):
4     def __init__(self, parent, id, title):
5     print "Frame __init__"
6     wx.Frame.__init__(self, parent, id, title)
7    
8     class App(wx.App):
9     def __init__(self, redirect=True, filename=None):
10     print "App __init__"
11     wx.App.__init__(self, redirect, filename)
12     def OnInit(self):
13     print "OnInit"
14     self.frame = Frame(parent=None, id=-1, title='Startup')
15     self.frame.Show()
16     self.SetTopWindow(self.frame)
17     print >> sys.stderr, "A pretend error message"
18     return True
19     def OnExit(self):
20     print "OnExit"
21    
22    
23     if __name__ == '__main__':
24     app = App(redirect=True)
25     print "before MainLoop"
26     app.MainLoop()
27     print "after MainLoop"