1 | import wx |
---|
2 | import wx.aui |
---|
3 | |
---|
4 | class 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 | |
---|
46 | app = wx.App() |
---|
47 | frame = MyFrame(None) |
---|
48 | frame.Show() |
---|
49 | app.MainLoop() |
---|