In the sample below, what do I need to do to control the initial location of the splits between windows?
I think this is the last detail I need to use AUI for my application layout.
import wx
import wx.aui
class MyFrame(wx.Frame):
def init(self):
super(MyFrame, self).init(None)
# make some panels
panel1 = wx.Panel(self)
panel2 = wx.Panel(self)
panel3 = wx.Panel(self)
# instantiate the AUI manager
self._mgr = wx.aui.AuiManager(self)
# add panels to manager
info = (wx.aui.AuiPaneInfo().Bottom().CaptionVisible(False))
self._mgr.AddPane(panel1, info)
info = (wx.aui.AuiPaneInfo().Left().CaptionVisible(False))
self._mgr.AddPane(panel2, info)
info = (wx.aui.AuiPaneInfo().CentrePane())
self._mgr.AddPane(panel3, info)
# tell the manager to 'commit' all the changes just made
self._mgr.Update()
# size the frame
self.Size = ((300,300))
self.Center()
app = wx.PySimpleApp()
MyFrame().Show()
app.MainLoop()
···
–
Mike Conley
Hi,
2009/11/23 Mike Conley:
In the sample below, what do I need to do to control the initial location of
the splits between windows?
I think this is the last detail I need to use AUI for my application layout.
import wx
import wx.aui
class MyFrame(wx.Frame):
def __init__(self):
super(MyFrame, self).__init__(None)
\# make some panels
panel1 = wx\.Panel\(self\)
panel2 = wx\.Panel\(self\)
panel3 = wx\.Panel\(self\)
\# instantiate the AUI manager
self\.\_mgr = wx\.aui\.AuiManager\(self\)
\# add panels to manager
info = \(wx\.aui\.AuiPaneInfo\(\)\.Bottom\(\)\.CaptionVisible\(False\)\)
self\.\_mgr\.AddPane\(panel1, info\)
info = \(wx\.aui\.AuiPaneInfo\(\)\.Left\(\)\.CaptionVisible\(False\)\)
self\.\_mgr\.AddPane\(panel2, info\)
info = \(wx\.aui\.AuiPaneInfo\(\)\.CentrePane\(\)\)
self\.\_mgr\.AddPane\(panel3, info\)
\# tell the manager to 'commit' all the changes just made
self\.\_mgr\.Update\(\)
\# size the frame
self\.Size = \(\(300,300\)\)
self\.Center\(\)
app = wx.PySimpleApp()
MyFrame().Show()
app.MainLoop()
You can't really "control" the split size (depending on the complexity
of the layout), but one thing you can do is to pass a BestSize to your
panes, i.e.:
info = (wx.aui.AuiPaneInfo().Bottom().CaptionVisible(False).BestSize((100,
200)))
self._mgr.AddPane(panel1, info)
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/