使用 Boa 构造函数向笔记本添加选项卡
我在使用 Boa Constructor 时遇到问题,特别是在使用选项卡式笔记本创建 GUI 时。我无法让应用程序显示多个选项卡或面板。 我已经在笔记本中制作了 wx.App->wx.Frame->wx.Notebook 和一些面板(如“检查器”的“Objs”选项卡中所示。
我一直在查看示例“Examples\advanced” \FramePanels' 从 boa 文件夹中查看代码,我可以明白为什么它不起作用。缺少一个函数,该函数似乎是由 boa 生成的(作为 Frame 类的一部分):
_custom_classes = {'wx.Panel': ['wxPanel1', 'wxPanel2', 'wxPanel3']}
def _init_coll_notebook1_Pages(self, parent):
# generated method, don't edit
parent.AddPage(imageId=-1, page=self.panel1, select=False,
text='Pages0')
parent.AddPage(imageId=-1, page=self.panel2, select=True, text='Pages1')
parent.AddPage(imageId=-1, page=self.panel3, select=False,
text='Pages2')
有还有一行调用代码的 _init_ctrls 部分中的函数。 所以我的问题是如何让 boa 添加这些代码行?
根据我的阅读,我可以手动编码,但我不想这样做。我使用 wxPython 只是为不能使用 CLI 的人制作几个简单的 gui,所以我想简化这个过程。
感谢您的帮助
I am having trouble using Boa Constructor, specifically in creating a GUI with a tabbed notebook. I cannot get the App to show the multiple tabs or the panels.
I have made wx.App->wx.Frame->wx.Notebook and some panels within the notebook (as shown in the 'Objs' tab of the 'Inspector'.
I have been looking at the example 'Examples\advanced\FramePanels' from the boa folder and looking at the code I can see why it doesn't work. There is a function missing which seems to be generated by boa (as part of the Frame class):
_custom_classes = {'wx.Panel': ['wxPanel1', 'wxPanel2', 'wxPanel3']}
def _init_coll_notebook1_Pages(self, parent):
# generated method, don't edit
parent.AddPage(imageId=-1, page=self.panel1, select=False,
text='Pages0')
parent.AddPage(imageId=-1, page=self.panel2, select=True, text='Pages1')
parent.AddPage(imageId=-1, page=self.panel3, select=False,
text='Pages2')
There is also a line calling the function in the _init_ctrls section of the code.
So my question is how can you get boa to add these lines of code?
From my reading I could code it manually, but I do not want to have to do that. My use of wxPython is just making several simple gui's for people who can't use CLI, so I want to streamline the process.
Thank you for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每次更改或添加新内容到 GUI 表单时,您需要:
然而更好的选择是使用wxFormBuilder,因为boa项目相当老,并且已经很长时间没有提交了。
http://sourceforge.net/projects/wxformbuilder/
Every time changing or adding something new to gui form you need to:
However the better choice is to use wxFormBuilder because boa project is rather old and have been uncommitted for a long time.
http://sourceforge.net/projects/wxformbuilder/