gpt4 book ai didi

python - 如何在wx.aui中保存面板位置

转载 作者:行者123 更新时间:2023-11-30 23:49:03 27 4
gpt4 key购买 nike

如何将 wx.aui 面板的位置保存在 *.ini 文件中(例如)?方法 GetPosition() 和 GetSize() 只提供默认大小和位置。

最佳答案

使用wx.aui.AuiManager.SavePerspective和wx.aui.AuiManager.LoadPerspective加载和保存布局数据(假设加载时有一组与保存时一致的 Pane )

对于 wxPython SavePerspective 只会返回一个字符串,您可以将其存储在某处,然后传递给 LoadPerspective。这可能无法 100% 可靠地工作 - 我之前遇到过很多问题。

wxWidgets 的文档在这里: http://docs.wxwidgets.org/2.8/wx_wxauimanager.html#wxauimanagersaveperspectivehttp://docs.wxwidgets.org/2.8/wx_wxauimanager.html#wxauimanagerloadperspective

对于管理器中的单个 Pane ,您可以在 wx.aui.AuiManager 上使用 SavePaneInfo 和 LoadPaneInfo

关于python - 如何在wx.aui中保存面板位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7803776/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com