I am trying to use AuiManager to manage the contents of notebook
pages. If I use wx.Notebook, it works all right. But if I switch to
wx.lib.agw.aui.AuiNotebook, then the panes can not be correctly
restored to original size after being minimized.
Attached is a short test to illustrate this. Try using different
versions of notebook by commenting our the appropriate line.
# -*- coding: utf-8 -*-
import wx
import wx.lib.agw.aui as aui
import wx.lib.mixins.inspection
class TheApp(wx.App, wx.lib.mixins.inspection.InspectionMixin):
def OnInit(self):
frame = MyFrame()
frame.Show()
self.Init()
return True
class AuiPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
self._mgr = aui.AuiManager(self)
p1 = wx.Panel(self, -1)
self._mgr.AddPane(p1, aui.AuiPaneInfo().
Name('content').Caption('Content').CenterPane())
p2 = wx.Panel(self, -1)
self._mgr.AddPane(p2, aui.AuiPaneInfo().
Name('test').Caption('Test Pane'). Left().
MinSize(wx.Size(200, -1)).CloseButton(True).MaximizeButton
(True).
MinimizeButton(True))
self._mgr.Update()
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, size=(800,600),
style=wx.DEFAULT_FRAME_STYLE)
nb = aui.AuiNotebook(self, -1)
# nb = wx.Notebook(self, -1)
p = AuiPanel(nb)
nb.AddPage(p, 'Aui Test')
self.Show()
if __name__ == '__main__':
app = TheApp(redirect=False)
app.MainLoop()
With the AuiNotebook, once the left pane is minized, click on the
restoe icon does not work. If one clicks on the gripper next to the
restore icon, the following exception is thrown:
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\lib\agw\aui
\auibar.py", line 3272, in OnLeftDown
manager.OnGripperClicked(self, managerClientPt, wx.Point
(x_drag_offset, y_drag_offset))
File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\lib\agw\aui
\framemanager.py", line 7491, in OnGripperClicked
raise Exception("Pane window not found")
Exception: Pane window not found