Added the sample code from wxPython In Action to the samples dir
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
29
wxPython/samples/wxPIA_book/Chapter-08/mdi.py
Normal file
29
wxPython/samples/wxPIA_book/Chapter-08/mdi.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import wx
|
||||
|
||||
class MDIFrame(wx.MDIParentFrame):
|
||||
def __init__(self):
|
||||
wx.MDIParentFrame.__init__(self, None, -1, "MDI Parent",
|
||||
size=(600,400))
|
||||
menu = wx.Menu()
|
||||
menu.Append(5000, "&New Window")
|
||||
menu.Append(5001, "E&xit")
|
||||
menubar = wx.MenuBar()
|
||||
menubar.Append(menu, "&File")
|
||||
self.SetMenuBar(menubar)
|
||||
self.Bind(wx.EVT_MENU, self.OnNewWindow, id=5000)
|
||||
self.Bind(wx.EVT_MENU, self.OnExit, id=5001)
|
||||
|
||||
def OnExit(self, evt):
|
||||
self.Close(True)
|
||||
|
||||
def OnNewWindow(self, evt):
|
||||
win = wx.MDIChildFrame(self, -1, "Child Window")
|
||||
win.Show(True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = wx.PySimpleApp()
|
||||
frame = MDIFrame()
|
||||
frame.Show()
|
||||
app.MainLoop()
|
||||
|
||||
|
Reference in New Issue
Block a user