Re: Problems with Tkinter and threads

2006-07-17 Thread Eric Brunel
On Mon, 17 Jul 2006 15:20:46 +0200, Claus Tondering <[EMAIL PROTECTED]> wrote: > Eric Brunel wrote: >> This is where the problem is: if you do just a event_generate without >> specifying the 'when' option, the binding is fired immediately in the >> current thread. To be sure that an event is cre

Re: Problems with Tkinter and threads

2006-07-17 Thread Claus Tondering
Eric Brunel wrote: > This is where the problem is: if you do just a event_generate without > specifying the 'when' option, the binding is fired immediately in the > current thread. To be sure that an event is created and that the thread > switch actually happens, do: > > app.event_generate("<>", wh

Re: Problems with Tkinter and threads

2006-07-17 Thread Eric Brunel
On Mon, 17 Jul 2006 12:58:08 +0200, Claus Tondering <[EMAIL PROTECTED]> wrote: > My Tkinter application has to receive events from a TCP connection. I > have chosen to do this in the following manner: > > The TCP communication takes place in a separate thread. When I receive > data, I generate a

Re: Problems with Tkinter and threads

2006-07-17 Thread Paul Rubin
"Claus Tondering" <[EMAIL PROTECTED]> writes: > Does this mean that I cannot even call the main thread's after_idle > method from another thread? I'm not certain, I've never tried it that way since there's no way I could be confident of its reliability even if it appeared to work. Just use after_i

Re: Problems with Tkinter and threads

2006-07-17 Thread Claus Tondering
Paul Rubin wrote: > Tkinter is simply not > thread safe and generating events from another thread can trigger race > conditions and who knows. Does this mean that I cannot even call the main thread's after_idle method from another thread? -- Claus Tondering -- http://mail.python.org/mailman/lis

Re: Problems with Tkinter and threads

2006-07-17 Thread Paul Rubin
"Claus Tondering" <[EMAIL PROTECTED]> writes: > The TCP communication takes place in a separate thread. When I receive > data, I generate an event in the Python application thus: > > app.event_generate("<>") I think all bets are off when you do that. Tkinter is simply not thread safe and gen

Problems with Tkinter and threads

2006-07-17 Thread Claus Tondering
My Tkinter application has to receive events from a TCP connection. I have chosen to do this in the following manner: The TCP communication takes place in a separate thread. When I receive data, I generate an event in the Python application thus: app.event_generate("<>") In the associated ev

Re: tkinter and threads

2005-05-04 Thread Philippe C. Martin
I might be wrong, but my experience is to keep all tkinter calls in the main thread and use queues to have other threads tell the main one what to do. Regards, Philippe Nir Aides wrote: > Hello, > > In Tkinter, is it safe to call widget.after(time, callback) from another > thread (other than

tkinter and threads

2005-05-04 Thread Nir Aides
Hello, In Tkinter, is it safe to call widget.after(time, callback) from another thread (other than the gui thread)? Thanks, Nir -- http://mail.python.org/mailman/listinfo/python-list