]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/MDIDemo.py
Some unicode fixes for the wxWisard wrappers
[wxWidgets.git] / wxPython / demo / MDIDemo.py
CommitLineData
06c0fba4
RD
1#!/usr/bin/env python
2
3from wxPython.wx import *
4from wxScrolledWindow import MyCanvas
5
6#----------------------------------------------------------------------
7
8class MyParentFrame(wxMDIParentFrame):
9 def __init__(self):
10 wxMDIParentFrame.__init__(self, None, -1, "MDI Parent", size=(600,400))
11
12 self.winCount = 0
13 menu = wxMenu()
14 menu.Append(5000, "&New Window")
15 menu.AppendSeparator()
16 menu.Append(5001, "E&xit")
17
18 menubar = wxMenuBar()
19 menubar.Append(menu, "&File")
20 self.SetMenuBar(menubar)
21
de20db99 22 self.CreateStatusBar()
06c0fba4
RD
23
24 EVT_MENU(self, 5000, self.OnNewWindow)
25 EVT_MENU(self, 5001, self.OnExit)
26
27
28 def OnExit(self, evt):
29 self.Close(true)
30
31
32 def OnNewWindow(self, evt):
33 self.winCount = self.winCount + 1
34 win = wxMDIChildFrame(self, -1, "Child Window: %d" % self.winCount)
f6bcfd97 35 canvas = MyCanvas(win)
06c0fba4
RD
36 win.Show(true)
37
38
39#----------------------------------------------------------------------
40
9c67cbec
RD
41if __name__ == '__main__':
42 class MyApp(wxApp):
43 def OnInit(self):
44 frame = MyParentFrame()
45 frame.Show(true)
46 self.SetTopWindow(frame)
47 return true
06c0fba4
RD
48
49
9c67cbec
RD
50 app = MyApp(0)
51 app.MainLoop()
06c0fba4
RD
52
53
54