]>
Commit | Line | Data |
---|---|---|
be05b434 RD |
1 | #!/usr/bin/env python |
2 | ||
3 | import wx | |
4 | import images | |
5 | ||
6 | class ToolbarFrame(wx.Frame): | |
7 | ||
8 | def __init__(self, parent, id): | |
9 | wx.Frame.__init__(self, parent, id, 'Toolbars', | |
10 | size=(300, 200)) | |
11 | panel = wx.Panel(self) | |
12 | panel.SetBackgroundColour('White') | |
13 | statusBar = self.CreateStatusBar() | |
14 | toolbar = self.CreateToolBar() | |
15 | toolbar.AddSimpleTool(wx.NewId(), images.getNewBitmap(), | |
16 | "New", "Long help for 'New'") | |
17 | toolbar.Realize() | |
18 | menuBar = wx.MenuBar() | |
19 | menu1 = wx.Menu() | |
20 | menuBar.Append(menu1, "&File") | |
21 | menu2 = wx.Menu() | |
22 | menu2.Append(wx.NewId(), "&Copy", "Copy in status bar") | |
23 | menu2.Append(wx.NewId(), "C&ut", "") | |
24 | menu2.Append(wx.NewId(), "Paste", "") | |
25 | menu2.AppendSeparator() | |
26 | menu2.Append(wx.NewId(), "&Options...", "Display Options") | |
27 | menuBar.Append(menu2, "&Edit") | |
28 | self.SetMenuBar(menuBar) | |
29 | ||
30 | def OnCloseMe(self, event): | |
31 | self.Close(True) | |
32 | ||
33 | def OnCloseWindow(self, event): | |
34 | self.Destroy() | |
35 | ||
36 | if __name__ == '__main__': | |
37 | app = wx.PySimpleApp() | |
38 | frame = ToolbarFrame(parent=None, id=-1) | |
39 | frame.Show() | |
40 | app.MainLoop() | |
41 |