[pygtk] Conflict: raw_input(), SIGALRM and pygtk

Michiel de Hoon mjldehoon at yahoo.com
Sat Jul 10 20:15:50 WST 2010


--- On Wed, 6/30/10, Ilya Murav'jov <muravev at yandex.ru> wrote:
> By the way, I don't see a reason for adding event loop
> support to Python,- which one (gtk, qt, GetMessage, ...)?
> They are very different and ... the strongest will win :)

In essence, they're all pretty much the same. Somewhere buried in the gtk/qt/wx/fltk/tcltk event loop is a call to select() (or MsgWaitForMultipleObjects() on Windows). The purpose of the main event loop support in gtk/qt/wx/fltk/tcltk is to keep track of which file descriptors to select() for, which timed functions to call, which functions to call before the call to select(), which functions to call after the call to select(), etc.

Now, gtk/qt/wx/fltk/tcltk each maintain their own registry of stuff to do in the event loop. For example, a list of file descriptors to select() for. So if the gtk event loop calls select(), it won't know about the file descriptors that for example qt wants to select() for.

If there were a way for gtk/qt/wx/fltk/tcltk to tell Python which file descriptors to select() for, and Python itself makes the call to select(), then all file descriptors get served appropriately. Same thing for everything else that needs to be done in the event loop.

--Michiel.



      


More information about the pygtk mailing list