WxPthon 问题:笔记本面板中的子面板
我目前是一名暑期研究生,帮助进行计算生物学研究,我的职责是制作一个可视化数据的 GUI。目前,我正在使用 wxPython 和 matplotlib。我在笔记本中设置了两个面板 - 第一个面板是选项,第二个面板是可视化所在的位置。然而,此外我希望第二个面板包含四个子面板 - 因此每个子面板中都有一个图表。不过,当我尝试将子面板添加到第二个面板时,它们似乎没有显示。任何意见或建议将不胜感激。
谢谢你!
这就是我的目标 - 目前可视化面板是空白的:
I am currently a summer research student helping out with computational biology research, and my role is to make a GUI that visualizes data. At the moment, I am using wxPython and matplotlib. I have two panels set up within a notebook - the first panel is the options and the second panel is where the visualization will be. However, in addition I would like the second panel to contain four subpanels within it--so it has a graph in each subpanel. Though, when I try to add subpanels to my secondpanel, they don't seem to show up. Any advice or suggestions would be appreciated.
Thank you!
Here is what my goal is - at the moment the Visualization panel is blank:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,我认为在选项卡面板顶部创建面板没有任何意义。那是多余的。您可以仅使用选项卡的面板作为顶部面板并消除 selfPanel。然后,您可以创建 4 个其他面板,其父面板为“self”(即选项卡本身)。
您需要 3 个 BoxSizer 或 1 个 GridSizer。我个人喜欢使用 BoxSizer 的灵活性,但这取决于您。将面板放入尺寸调整器中,并将它们设置为 EXPAND,并将其比例设置为 1。类似于:
myBoxSizer.Add(panelOne, 1, wx.EXPAND|wx.ALL, 10)
应该可以。
First of all, I don't see any point in creating a panel on top of the tab's panel. That's redundant. You can just use the tab's panel as the top panel and eliminate selfPanel. Then you can just create 4 other panels with a parent of "self" (i.e. the tab itself).
You'll need 3 BoxSizers or 1 GridSizer. I personally like the flexibility of using the BoxSizers, but that's up to you. Put the panels in the sizers and set them to EXPAND and give them a proportion of 1. Something like:
myBoxSizer.Add(panelOne, 1, wx.EXPAND|wx.ALL, 10)
That should work.