ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/learning/wxpython/Script3.py
Revision: 591
Committed: Tue Nov 3 22:45:12 2015 UTC (10 years, 4 months ago) by nino.borges
Content type: text/x-python
File size: 780 byte(s)
Log Message:
Moved dir out of main dir.

File Contents

# Content
1 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"