开发者

Is it possible to delete/remove a wx.aui.AuiManager pane?

开发者 https://www.devze.com 2022-12-22 21:55 出处:网络
I want to remove a pane from the wx.aui.A开发者_开发技巧uiManager. Is it possible?I\'m not sure, but this might work:

I want to remove a pane from the wx.aui.A开发者_开发技巧uiManager.

Is it possible?


I'm not sure, but this might work:

manager.DetachPane(pane)
pane.Destroy()
manager.Update()


I was seeing segfaults due to stale (deleted) panels left in an AuiManager; I cleared them with the following:

nbpanes = manager.GetAllPanes()
for pane in nbpanes:
    pane.DestroyOnClose()
    manager.ClosePane(pane)

nbpanes is a list of PaneInfo objects


panel_list = []

manager.AddPane(panel1,....)
panel_list.append(panel1)

manager.AddPane(panel2,....)
panel_list.append(panel2)
#and so on..

Creating a list and append the things (place of managers) to it will make it easy, I think.Then;

Instead Destroy, ShowPane(i, False) is reasonable for reusing. And don't forget the Update():

for i in panel_list:
    manager.ShowPane(i, False)
    manager.Update()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号