X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/05a03b016a6fb93bdb81a25eac9fc4834fe6f95e..d0ee33f5c6908b4ac5e1364381f0ef00942e3936:/wxPython/samples/simple/simple.py diff --git a/wxPython/samples/simple/simple.py b/wxPython/samples/simple/simple.py index 95df6d5073..6f0bc5a12d 100644 --- a/wxPython/samples/simple/simple.py +++ b/wxPython/samples/simple/simple.py @@ -1,6 +1,6 @@ #---------------------------------------------------------------------- -# A very simple wxPython example. Just a wxFrame, wxPanel, -# wxStaticText, wxButton, and a wxBoxSizer, but it shows the basic +# A very simple wxPython example. Just a wx.Frame, wx.Panel, +# wx.StaticText, wx.Button, and a wx.BoxSizer, but it shows the basic # structure of any wxPython application. #---------------------------------------------------------------------- @@ -13,7 +13,8 @@ class MyFrame(wx.Frame): and has a simple menu. """ def __init__(self, parent, title): - wx.Frame.__init__(self, parent, -1, title, size=(350, 200)) + wx.Frame.__init__(self, parent, -1, title, + pos=(150, 150), size=(350, 200)) # Create the menubar menuBar = wx.MenuBar() @@ -70,8 +71,16 @@ class MyFrame(wx.Frame): print "Having fun yet?" -app = wx.PySimpleApp() -frame = MyFrame(None, "Simple wxPython App") -frame.Show(True) +class MyApp(wx.App): + def OnInit(self): + frame = MyFrame(None, "Simple wxPython App") + self.SetTopWindow(frame) + + print "Print statements go to this stdout window by default." + + frame.Show(True) + return True + +app = MyApp(redirect=True) app.MainLoop()