Kirix Support Forums

wxAuiManager does not hide/show panes correctly????

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxAuiManager does not hide/show panes correctly????

Postby gybrush on Mon Dec 08, 2008 3:34 am


below is a super short wxPython program. The problem with it is that if I resize the bottom pane to some other size than the original (e.g. make it higher), press key to hide it and then press key to show it up again it looses its last size and is always reset to some initial size.

Note that I do not delete the pane or something, I just hide it and then show it again.

Is this intended or it is a bug? Any way to avoid this and show the pane with its last visible size?

--------- EXAMPLE CODE ------------
Code: Select all

import wx
import wx.aui

def _(text):
   return text

class MyFrame(wx.Frame):
  def __init__(self, parent):
     wx.Frame.__init__(self, parent, -1, _("wxAUI Test"),

     # notify wxAUI which frame to use
     self.mgr = wx.aui.AuiManager()

     # create several text controls
     text1 = wx.TextCtrl(self, -1, _("Pane 1 - left"),
                      wx.DefaultPosition, wx.Size(200,150),
                      wx.NO_BORDER | wx.TE_MULTILINE)

     self.text2 = wx.TextCtrl(self, -1, _("Pane 2 - bottom"),
                      wx.DefaultPosition, wx.Size(200,150),
                      wx.NO_BORDER | wx.TE_MULTILINE);

     text3 = wx.TextCtrl(self, -1, _("Main content window"),
                      wx.DefaultPosition, wx.Size(200,150),
                      wx.NO_BORDER | wx.TE_MULTILINE);

     # add the panes to the manager
     self.mgr.AddPane(text1, wx.LEFT, _("pane1"));
     self.mgr.AddPane(self.text2, wx.BOTTOM, _("pane2"));
     self.mgr.AddPane(text3, wx.CENTER, _("pane3"));

     self.Bind(wx.EVT_KEY_UP, self.OnKey)

     # tell the manager to "commit" all the changes just made

  def OnKey(self, event):
      # toggle panel state: visible <-> hidden
      auiPanelInfo = self.mgr.GetPane(self.text2)
      auiPanelInfo.Show(not auiPanelInfo.IsShown())

# our normal wxApp-derived class, as usual
class MyApp(wx.App):
   def OnInit(self):
      frame = MyFrame(None)
      return True

myApp = MyApp(0)
Registered User
Posts: 1
Joined: Mon Dec 08, 2008 3:31 am

Return to wxAUI Questions, Thoughts & Feedback