]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-04/pycrust-foundation.py
4 from wx
.py
.shell
import ShellFrame
5 from wx
.py
.filling
import FillingFrame
8 class ToolbarFrame(wx
.Frame
):
10 def __init__(self
, parent
, id):
11 wx
.Frame
.__init
__(self
, parent
, id, 'Toolbars',
13 panel
= wx
.Panel(self
, -1)
14 panel
.SetBackgroundColour('White')
15 statusBar
= self
.CreateStatusBar()
16 toolbar
= self
.CreateToolBar()
17 toolbar
.AddSimpleTool(wx
.NewId(), images
.getNewBitmap(),
18 "New", "Long help for 'New'")
20 menuBar
= wx
.MenuBar()
22 menuBar
.Append(menu1
, "&File")
24 menu2
.Append(wx
.NewId(), "&Copy", "Copy in status bar")
25 menu2
.Append(wx
.NewId(), "C&ut", "")
26 menu2
.Append(wx
.NewId(), "Paste", "")
27 menu2
.AppendSeparator()
28 menu2
.Append(wx
.NewId(), "&Options...", "Display Options")
29 menuBar
.Append(menu2
, "&Edit")
32 shell
= menu3
.Append(-1, "&Python shell",
33 "Open Python shell frame")
34 filling
= menu3
.Append(-1, "&Namespace viewer",
35 "Open namespace viewer frame")
36 menuBar
.Append(menu3
, "&Debug")
37 self
.Bind(wx
.EVT_MENU
, self
.OnShell
, shell
)
38 self
.Bind(wx
.EVT_MENU
, self
.OnFilling
, filling
)
40 self
.SetMenuBar(menuBar
)
42 def OnCloseMe(self
, event
):
45 def OnCloseWindow(self
, event
):
48 def OnShell(self
, event
):
49 frame
= ShellFrame(parent
=self
)
52 def OnFilling(self
, event
):
53 frame
= FillingFrame(parent
=self
)
56 if __name__
== '__main__':
57 app
= wx
.PySimpleApp()
58 app
.frame
= ToolbarFrame(parent
=None, id=-1)