controling a pyglet window from a gui program

404 visualizações
Pular para a primeira mensagem não lida

fccoelho

não lida,
26 de out. de 2007, 10:58:5926/10/2007
para pyglet-users
Hi,

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

Alex Holkner

não lida,
26 de out. de 2007, 20:44:1226/10/2007
para pyglet...@googlegroups.com

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.

fccoelho

não lida,
27 de out. de 2007, 07:56:2227/10/2007
para pyglet-users
Well I tried to find an event like that in the Qt 4 documentation but
couldn't.

I ask in the PyQt list and post the answer back here to help other
people who might be interested in this.

thanks

Alex Holkner

não lida,
27 de out. de 2007, 09:22:1227/10/2007
para pyglet...@googlegroups.com
I found this in the Qt documentation at http://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 with 0 timeout. More sophisticated idle processing schemes can be achieved using processEvents().

Should put you on the right track..

Alex.

fccoelho

não lida,
29 de out. de 2007, 13:58:3029/10/2007
para pyglet-users
Thanks Alex,

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.
>

Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem