git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
		
			
				
	
	
		
			30 lines
		
	
	
		
			772 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			772 B
		
	
	
	
		
			Python
		
	
	
	
	
	
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()
 | 
						|
        
 | 
						|
 |