Python/wxPython:auinotebook 获取所有页面
我有一个auinotebook,有没有办法获取笔记本中所有页面的列表?当用户从列表中选择一个操作时,一个新页面将添加到笔记本中。如果他们再次选择该操作,则不应再次添加该页面(相反,将为他们选择该页面)。我看不出如何做到这一点? 谢谢!
I have an auinotebook, is there anyway to get a list of all pages in the notebook? When the user selects an action from a list, a new page is added to the notebook. If they select that action again, then the page should not be added again (instead, that page will be selected for them). I can't see to figure out how to do this??
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您正在使用 wx.lib.agw.aui.AuiNotebook:
现在您可以迭代笔记本的页面:
Assuming you are using wx.lib.agw.aui.AuiNotebook:
Now you can iterate over the pages of the notebook:
您没有提及您正在使用哪个 AuiNotebook。是wx.aui自带的还是wx.lib.agw.aui自带的?无论哪种方式,我认为您可以使用 GetChildren() 来获取笔记本面板的列表,并根据需要迭代这些面板。还有一个 GetPageCount,您可以将其与 GetPageInfo 和 GetPageText 结合使用(最后三个方法位于 agw 版本中...不确定它们是否包含在另一个版本中)。有关详细信息,请参阅文档:http://xoomer.virgilio.it/infinity77/AGW_Docs/aui.auibook.AuiNotebook.html#aui-auibook-auinotebook
或者您可以交叉发布到 wxPython 用户列表。
You don't mention which AuiNotebook you're using. Is it the one that comes with wx.aui or wx.lib.agw.aui? Either way, I would think you could use GetChildren() to get a list of the notebook's panels and iterate through those as necessary. There's also a GetPageCount that you might be able to use in conjunction with GetPageInfo and GetPageText (these last three methods are in the agw version...not sure if they're included in the other). See the documentation for more information: http://xoomer.virgilio.it/infinity77/AGW_Docs/aui.auibook.AuiNotebook.html#aui-auibook-auinotebook
Or you could cross-post to the wxPython user's list.