REPOST: Re: strange Tkinter problem

Alex Martelli aleax at aleax.it
Fri Dec 28 11:00:14 EST 2001


"tjiit" <tjiit at yahoo.com> wrote in message
news:a0baad$vu4$01$1 at news.t-online.com...
> I have an application using a Tkinter GUI which starts a network
> connection if you click on a button. The strange thing is that the GUI
> freezes and the connection is established. Does this mean that Tkinter
> executes the functions bound do an event and then returns when the
> function has ended? I thought it would to kinda multi-threading so it

No!  If threads were generated "behind your back", you'd have a very
hard time handling the resulting mess.

> could handle large events and keep interactive while doing it.
> Can anyone give me a (some) hints?

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965

The Recipe is about the other, harder half of the problem -- a
thread different from the GUI-controlling one wants to talk
with the GUI-thread.  Starting a new thread from the GUI one
(e.g. from a callback: all callbacks run on the GUI thread!)
is easy, with module threading; the problem is coordinating
multiple threads, and the recipe helps with that part.


Alex

========= WAS CANCELLED BY =======:
Path: news.sol.net!spool0-milwwi.newsops.execpc.com!newsfeeds.sol.net!newspump.sol.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!enews.sgi.com!news-xfer.nuri.net!feeder.kornet.net!news1.kornet.net!ua4canc3ll3r
From: "Alex Martelli" <aleax at aleax.it>
Newsgroups: comp.lang.python
Subject: cmsg cancel <a0i4ub$kj2$1 at serv1.iunet.it>
Control: cancel <a0i4ub$kj2$1 at serv1.iunet.it>
Date: Mon, 31 Dec 2001 02:52:03 GMT
Organization: A poorly-installed InterNetNews site
Lines: 2
Message-ID: <cancel.a0i4ub$kj2$1 at serv1.iunet.it>
NNTP-Posting-Host: 211.57.49.2
X-Trace: news2.kornet.net 1009775263 27193 211.57.49.2 (31 Dec 2001 05:07:43 GMT)
X-Complaints-To: usenet at news2.kornet.net
NNTP-Posting-Date: Mon, 31 Dec 2001 05:07:43 +0000 (UTC)
X-No-Archive: yes
X-Unac4ncel: yes
X-Commentary: I love NewsAgent 1.10 and the Sandblaster Cancel Engine Build 74 (19 March 1999)

This message was cancelled from within Mozilla.



More information about the Python-list mailing list