]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/MDIDemo.py
3 from wxPython
.wx
import *
4 from wxScrolledWindow
import MyCanvas
6 #----------------------------------------------------------------------
8 class MyParentFrame(wxMDIParentFrame
):
10 wxMDIParentFrame
.__init
__(self
, None, -1, "MDI Parent", size
=(600,400))
14 menu
.Append(5000, "&New Window")
15 menu
.AppendSeparator()
16 menu
.Append(5001, "E&xit")
19 menubar
.Append(menu
, "&File")
20 self
.SetMenuBar(menubar
)
22 self
.CreateStatusBar()
24 EVT_MENU(self
, 5000, self
.OnNewWindow
)
25 EVT_MENU(self
, 5001, self
.OnExit
)
28 def OnExit(self
, evt
):
32 def OnNewWindow(self
, evt
):
33 self
.winCount
= self
.winCount
+ 1
34 win
= wxMDIChildFrame(self
, -1, "Child Window: %d" % self
.winCount
)
35 canvas
= MyCanvas(win
)
39 #----------------------------------------------------------------------
41 if __name__
== '__main__':
44 wxInitAllImageHandlers()
45 frame
= MyParentFrame()
47 self
.SetTopWindow(frame
)