source: SHX/trunk/src/sandbox/aui2.py @ 74

Revision 74, 1.6 KB checked in by marcus, 15 years ago (diff)
  • layout test
  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Rev Id Date
Line 
1import wx
2import wx.aui
3
4class MyFrame(wx.Frame):
5
6    def __init__(self, parent, id=-1, title='wx.aui Test',
7                 pos=wx.DefaultPosition, size=(800, 600),
8                 style=wx.DEFAULT_FRAME_STYLE):
9        wx.Frame.__init__(self, parent, id, title, pos, size, style)
10
11        self._mgr = wx.aui.AuiManager(self)
12
13        # create several text controls
14        text1 = wx.TextCtrl(self, -1, 'Pane 1 - sample text',
15                            wx.DefaultPosition, wx.Size(200,150),
16                            wx.NO_BORDER | wx.TE_MULTILINE)
17
18        text2 = wx.TextCtrl(self, -1, 'Pane 2 - sample text',
19                            wx.DefaultPosition, wx.Size(200,150),
20                            wx.NO_BORDER | wx.TE_MULTILINE)
21
22        text3 = wx.TextCtrl(self, -1, '',
23                            wx.DefaultPosition, wx.Size(200,150),
24                            wx.NO_BORDER | wx.TE_MULTILINE)
25
26        # add the panes to the manager
27                         
28        self._mgr.AddPane(text2, wx.aui.AuiPaneInfo().Caption('Pane Number Two').Bottom())
29        self._mgr.AddPane(text1, wx.aui.AuiPaneInfo().Caption('Pane Number One').Left().
30                          Layer(1))
31        self._mgr.AddPane(text3, wx.CENTER)
32
33        # tell the manager to 'commit' all the changes just made
34        self._mgr.Update()
35
36        self.Bind(wx.EVT_CLOSE, self.OnClose)
37
38
39    def OnClose(self, event):
40        # deinitialize the frame manager
41        self._mgr.UnInit()
42        # delete the frame
43        self.Destroy()
44
45
46app = wx.App()
47frame = MyFrame(None)
48frame.Show()
49app.MainLoop()
Note: See TracBrowser for help on using the repository browser.