| 1 |
ninoborges |
3 |
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" |