AuiManager doesn't work well in AuiNotebook panels

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

Anybody noticed the bug report? Is there any bug tracking system for
awg.aui or wxPython where the bug can get onto somebody's todo list?

···

On Jul 10, 2:42 pm, Hong Yuan <hongyuan1...@gmail.com> wrote:

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\(&#39;content&#39;\)\.Caption\(&#39;Content&#39;\)\.CenterPane\(\)\)

    p2 = wx\.Panel\(self, \-1\)
    self\.\_mgr\.AddPane\(p2, aui\.AuiPaneInfo\(\)\.
        Name\(&#39;test&#39;\)\.Caption\(&#39;Test Pane&#39;\)\. 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

Hi,

Hong Yuan wrote:

Anybody noticed the bug report? Is there any bug tracking system for
awg.aui or wxPython where the bug can get onto somebody's todo list?
  

I changed things around a bit and I think the following is about what you want, but I am not sure.

Hope the following helps.

Werner

# -*- 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 MyFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, size=(800,600),
                          style=wx.DEFAULT_FRAME_STYLE)

        self.mainPanel = wx.Panel(self)
        self._mgr = aui.AuiManager()
        self._mgr.SetManagedWindow(self.mainPanel)

        nb = aui.AuiNotebook(self.mainPanel, -1)
        nbp1 = wx.Panel(nb)
        nb.AddPage(nbp1, 'Notebook - p1', False)
               nbp2 = wx.Panel(nb)
        nb.AddPage(nbp2, 'Notebook - p2', False)

        p1 = wx.Panel(self.mainPanel)
        p2 = wx.Panel(self.mainPanel)
               self._mgr.AddPane(nb, aui.AuiPaneInfo().
            Name('notebook').Caption('Notebook').CenterPane())
               self._mgr.AddPane(p1, aui.AuiPaneInfo().
            Name('content').Caption('Content').CenterPane())

        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()

        self.Show()

if __name__ == '__main__':
    app = TheApp(redirect=False)
    app.MainLoop()

Thanks for looking into this.

However your modification is not what I wanted. I do not want a
AuiNotebook to be managed as a pane in some other frame. I want each
notebook page of the AuiNotebook to be the containing panel for an
AuiManager. The managed panes should be within the notebook page.

According to AUI documenation, an AuiManager should be able to manage
any container window, including a notebook page. In fact, it works
with wx.Notebook and with wx.aui.AuiNotebook. But sadly something is
wrong when it is used with wx.lib.agw.aui.AuiNotebook. If possible, I
would like to attach an image. But with Google Groups this doesn not
seem to be possible.

The platform is Windows XP, Python 2.5.4 and wxPython 2.8.10.1.

Hong

···

On Jul 17, 4:40 pm, "Werner F. Bruhin" <wbru...@gmail.com> wrote:

Hi,

Hong Yuan wrote:
> Anybody noticed the bug report? Is there any bug tracking system for
> awg.aui or wxPython where the bug can get onto somebody's todo list?

I changed things around a bit and I think the following is about what
you want, but I am not sure.

Hope the following helps.

Hong Yuan wrote:

···

On Jul 17, 4:40 pm, "Werner F. Bruhin" <wbru...@gmail.com> wrote:
  

Hi,

Hong Yuan wrote:
    

Anybody noticed the bug report? Is there any bug tracking system for
awg.aui or wxPython where the bug can get onto somebody's todo list?
      

I changed things around a bit and I think the following is about what
you want, but I am not sure.

Hope the following helps.

Thanks for looking into this.

However your modification is not what I wanted. I do not want a
AuiNotebook to be managed as a pane in some other frame. I want each
notebook page of the AuiNotebook to be the containing panel for an
AuiManager. The managed panes should be within the notebook page.

According to AUI documenation, an AuiManager should be able to manage
any container window, including a notebook page. In fact, it works
with wx.Notebook and with wx.aui.AuiNotebook. But sadly something is
wrong when it is used with wx.lib.agw.aui.AuiNotebook. If possible, I
would like to attach an image. But with Google Groups this doesn not
seem to be possible.
  

O.k. I think I get this too now. I see the same problem, i.e. a minimized pane can not be maximized - but I don't get the exception you get.

Werner

Hong Yuan wrote:
...

However your modification is not what I wanted. I do not want a
AuiNotebook to be managed as a pane in some other frame. I want each
notebook page of the AuiNotebook to be the containing panel for an
AuiManager. The managed panes should be within the notebook page.

According to AUI documenation, an AuiManager should be able to manage
any container window, including a notebook page. In fact, it works
with wx.Notebook and with wx.aui.AuiNotebook. But sadly something is
wrong when it is used with wx.lib.agw.aui.AuiNotebook. If possible, I
would like to attach an image. But with Google Groups this doesn not
seem to be possible.

The platform is Windows XP, Python 2.5.4 and wxPython 2.8.10.1.
  

Just updated from SVN and now I see the exception too.

Werner

O.k. I think I get this too now. I see the same problem, i.e. a
minimized pane can not be maximized - but I don't get the exception you get.

Werner

To see the exception, minimize the pane, then move the mouse onto the
vertical bar (the 3 vertical dots which I believe is called the
gripper) left of the restore icon until the cursor is changed to a
cross. Then left click.

Hong Yuan wrote:

If possible, I
would like to attach an image. But with Google Groups this doesn not
seem to be possible.

It's possible if you send your message via email instead of the web interface.

···

--
Robin Dunn
Software Craftsman

Hi Hong,

2009/7/10 Hong Yuan:

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\(&#39;content&#39;\)\.Caption\(&#39;Content&#39;\)\.CenterPane\(\)\)

   p2 = wx\.Panel\(self, \-1\)
   self\.\_mgr\.AddPane\(p2, aui\.AuiPaneInfo\(\)\.
       Name\(&#39;test&#39;\)\.Caption\(&#39;Test Pane&#39;\)\. 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

Please enter a bug report about it at:

http://trac.wxwidgets.org/

Specifying that the bug is AGW-specific and assign it to me, otherwise
it will get lost in the maze of my e-mail account.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Hi Hong and Andrea,

Andrea Gavana wrote:
...

Please enter a bug report about it at:

http://trac.wxwidgets.org/

Specifying that the bug is AGW-specific and assign it to me, otherwise
it will get lost in the maze of my e-mail account.
  

As I am also interested in this one and not seen it added by Hong I went ahead and created a ticket .

http://trac.wxwidgets.org/ticket/11039

A simple test case is attached to the ticket.

Werner