wxPython刷新框架
标题说明了一切。我找不到方法来做到这一点....Refresh() 除了使程序崩溃之外不执行任何操作。
我所处的情况是,我有一个从“主”框架启动的框架。该框架对“主”框架的菜单栏和面板进行了更改。我可以调用什么来刷新主框架,从第二帧?
Title says it all.I can't find a way to do it... .Refresh() doens't do anything, other than crash the program.
The situation I'm in, is that I have a frame which is launched from the "main" frame. This frame makes changes to the "main" frame's menu bar and panel. What can I call to refresh the main frame, from the second frame?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个可以用 pubsub 来完成。让第二个框架向第一个框架发布一条消息,告诉它刷新。我实际上认为你会想使用 Layout() 。这就是我在删除或添加可见元素时通常使用的方法。从菜单中删除项目时,您不需要 Refresh() 菜单。至少,wxPython 演示中的示例没有这样做。
This one could be done with pubsub. Have the second frame publish a message to the first frame telling it to refresh. I actually think you'll want to use Layout() though. That's what I usually use when I remove or add visible elements. You shouldn't need to Refresh() a menu when removing items from it. At least, the example in the wxPython demo doesn't do that.