Has anyone tried to control a pyglet window from a gui program? like a
pyqt application?
I want to know if there are any problems in switching from the PyQT
execution loop to the pyglet window and back...
thanks,
Flávio
Rather than switching between two event loops, you'll get better
behaviour by calling pyglet's `dispatch_events` functions from within
a QT idle event. (Not having used QT, I'm not sure of the name of
such an event, but it almost certainly exists).
Alex.
I ask in the PyQt list and post the answer back here to help other
people who might be interested in this.
thanks
To make your application perform idle processing, i.e. executing a special function whenever there are no pending events, use a QTimer with 0 timeout. More sophisticated idle processing schemes can be achieved using processEvents().
That' what I needed, but you have to take care to start your time
consuming python function on a separate thread in order for the GUI to
get a chance to process its idle events...
thanks,
Flávio
On Oct 27, 11:22 am, "Alex Holkner" <alex.holk...@gmail.com> wrote:
> I found this in the Qt documentation athttp://doc.trolltech.com/4.0/qeventloop.html:
>
> To make your application perform idle processing, i.e. executing a special
>
> > function whenever there are no pending events, use a QTimer<http://doc.trolltech.com/4.0/qtimer.html>with 0 timeout. More sophisticated idle processing schemes can be achieved
> > using processEvents<http://doc.trolltech.com/4.0/qeventloop.html#processEvents>
> > ().
>
> Should put you on the right track..
>
> Alex.
>