On Tue, Feb 10, 2004 at 05:03:55PM -0500, Dave Aitel wrote:
> So in order to address the threading bugs in Win32 once and for all, I 
> submit this little code snippet which is a very Proof of Concept thing I 
> wanted to use just to see if the concept worked and wasn't too aweful.
> 

Some draconian firewalls will squawk about the use of an INET socket
(not that you really have a choice of sockets on Windows). This may just
be a minor inconvenice. 

Why don't you try the attached module? That way you can just use a Win32
event.

import gsource
import win32event
queue_event = win32event.CreateEvent(None, 0, 0, None)

qeid = gsource.add(queue_event, gsource.IO_IN, callback, arg)

When you want to run the queue callback just do a
win32event.SetEvent(queue_event).

That's all there is to it!

The setup.py file was something I just hacked up for this email. I
think it should work. If you use MSVC you'll probably have to get the
dsextras.py module to pass a --msvc-syntax to pkgconfig.

--jkl

Attachment: gsource-test.tar.gz
Description: Binary data

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to