I'm using wx.aui to build my user interface. I'm defining a class that inherits from wx.Panel and I need to change the content of that panel when its window pane is resized.
I'm using code very similar to the code below (which is a modified version of sample code found here).
My question is: is there a wx.Panel method being called behind the scenes by the AuiManager that I can overload? If not, how can my ControlPanel object know that it's being resized?
For instance, if I run this code and drag up the horizontal divider between the upper and lower panes on the right, how is the upper right panel told that its size just changed?
import wx
import wx.aui
class ControlPanel(wx.Panel):
def __init__(self, *args, **kwargs):
wx.Panel.__init__(self, *args, **kwargs)
class MyFrame(wx.Frame):
def __init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
self.mgr = wx.aui.AuiManager(self)
leftpanel = ControlPanel(self, -1, size = (200, 150))
rightpanel = ControlPanel(self, -1, size = (200, 150))
bottompanel = ControlPanel(self, -1, size = (200, 150))
self.mgr.AddPane(leftpanel, wx.aui.AuiPaneInfo().Bottom())
self.mgr.AddPane(rightpanel, wx.aui.AuiPaneInfo().Left().Layer(1))
self.mgr.AddPane(bottompanel, wx.aui.AuiPaneInfo().Center().Layer(2))
self.mgr.Update()
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None, -1, '07_wxaui.py')
frame.Show()
self.SetTopWindow(frame)
return 1
if __name__ == "__main__":
app = MyApp(0)
app.MainLoop()