wxPython - GUI完全绘制后运行函数
执行此操作的标准方法是什么?
我不希望打开程序时出现延迟,但我希望我的函数在绘制 GUI 后立即运行。
我尝试过 wx.CallAfter(foo.bar) ,窗口 (Frame
) 立即打开,但在我的函数执行之前不会绘制按钮。
What would be the standard way to do this?
I don't want there to be a delay when opening the program, but I want my function to run as soon as GUI has been drawn.
I've tried wx.CallAfter(foo.bar)
, the Window (Frame
) opens immediately, but the buttons don't get drawn until my function has executed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这会将一个事件放入事件队列中,该事件将在 0 毫秒后调用该函数。
这会导致该函数在 GUI 绘制完成后立即运行。
This puts an event into the event queue that will call the function after 0 milliseconds.
This causes the function to be run as soon as GUI has been drawn.