简体   繁体   English

相当于wxPython的PyQt4 processEvents

[英]equivalent of PyQt4 processEvents for wxPython

I'm working on PythonOCC, which is a terrific framework for the rapid prototyping of sophisticated CAD apps (it rocks!). 我正在研究PythonOCC,这是一个用于快速构建复杂CAD应用程序原型的绝佳框架(真是太难了!)。 PythonOCC comes with a viewer, that works both in wxPython and PyQt4 ( actually comes with x11 and a webgl viewer too... ). PythonOCC附带了一个查看器,该查看器在wxPython和PyQt4中都可以使用(实际上还随附x11和一个webgl查看器...)。

Something incredibly useful in the PyQt4 version of the viewer that comes with PythonOCC is that while debugging is that while pdb.set_trace() is called, events are still processed due to QtGui.QApplication.processEvents() goodness. PythonOCC附带的查看器PyQt4版本中令人难以置信的有用之在于,尽管调试是调用pdb.set_trace()时,由于QtGui.QApplication.processEvents()的优点,事件仍会被处理。 That makes a world of different when you're working on geometry and still are able to navigate in the viewer. 当您处理几何图形并且仍然能够在查看器中导航时,这将带来不同的世界。 What I'd love to know is how I can mimic this behaviour in wxPython? 我想知道的是如何在wxPython中模仿这种行为? This would make a world of difference for me. 这将为我带来与众不同的世界。

According to the wxWidgets' wiki, you can use the App object's Yield command to flush the event queue: http://wiki.wxwidgets.org/Custom_Events . 根据wxWidgets的Wiki,您可以使用App对象的Yield命令刷新事件队列: http : //wiki.wxwidgets.org/Custom_Events You might be able to do it with Update or Refresh, but I'm not really sure. 您可能可以使用“更新”或“刷新”来执行此操作,但是我不确定。 Here's some event documentation too: 这里也有一些事件文档:

You might want to cross-post to the wxPython mailing list too. 您可能也想交叉发布到wxPython邮件列表。 The creator of wxPython hangs out there and I'm sure he'll know for sure. wxPython的创建者在那里闲逛,我确定他一定会知道的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM