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
wxwidgets:
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"),
wx.DefaultPosition)
# notify wxAUI which frame to use
self.mgr = wx.aui.AuiManager()
self.mgr.SetManagedWindow(self)
# 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
self.mgr.Update()
def OnKey(self, event):
# toggle panel state: visible <-> hidden
auiPanelInfo = self.mgr.GetPane(self.text2)
auiPanelInfo.Show(not auiPanelInfo.IsShown())
self.mgr.Update()
# our normal wxApp-derived class, as usual
class MyApp(wx.App):
def OnInit(self):
frame = MyFrame(None)
self.SetTopWindow(frame)
frame.Show()
return True
myApp = MyApp(0)
myApp.MainLoop()