]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-01/python_compare.py
6 frame
= MyFrame("Hello World", (50, 60), (450, 340))
8 self
.SetTopWindow(frame
)
11 class MyFrame(wx
.Frame
):
13 def __init__(self
, title
, pos
, size
):
14 wx
.Frame
.__init
__(self
, None, -1, title
, pos
, size
)
16 menuFile
.Append(1, "&About...")
17 menuFile
.AppendSeparator()
18 menuFile
.Append(2, "E&xit")
19 menuBar
= wx
.MenuBar()
20 menuBar
.Append(menuFile
, "&File")
21 self
.SetMenuBar(menuBar
)
22 self
.CreateStatusBar()
23 self
.SetStatusText("Welcome to wxPython!")
24 self
.Bind(wx
.EVT_MENU
, self
.OnAbout
, id=1)
25 self
.Bind(wx
.EVT_MENU
, self
.OnQuit
, id=2)
27 def OnQuit(self
, event
):
30 def OnAbout(self
, event
):
31 wx
.MessageBox("This is a wxPython Hello world sample",
32 "About Hello World", wx
.OK | wx
.ICON_INFORMATION
, self
)
34 if __name__
== '__main__':