开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜