<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.12.3">
</HEAD>
<BODY>
so if you do compile that way, Tk is thread safe, I can have separate mainloops in different threads and they can all post to each others windows, etc?<BR>
<BR>
On Fri, 2008-10-24 at 17:45 -0200, Guilherme Polo wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">On Fri, Oct 24, 2008 at 5:31 PM, Allen Taylor</FONT>
<FONT COLOR="#000000">&lt;<A HREF="mailto:Allen.Taylor@mdacorporation.com">Allen.Taylor@mdacorporation.com</A>&gt; wrote:</FONT>
<FONT COLOR="#000000">&gt; Hi Guilherme,</FONT>
<FONT COLOR="#000000">&gt; The versions of Python and Tk used are the default packages installed on</FONT>
<FONT COLOR="#000000">&gt; Linux (Ubuntu 6.06 LTS). I don't know whether the default install is</FONT>
<FONT COLOR="#000000">&gt; compiled with --enable-threads or not. So, mtTkinter seems to be handy if</FONT>
<FONT COLOR="#000000">&gt; you want to use the default installed packages?</FONT>
<FONT COLOR="#000000">&gt; Allen</FONT>
<FONT COLOR="#000000">&gt;</FONT>

<FONT COLOR="#000000">To check for --enable-threads try this:</FONT>

<FONT COLOR="#000000">import Tkinter</FONT>
<FONT COLOR="#000000">Tkinter.Tk().getvar(&quot;tcl_platform(threaded)&quot;)</FONT>

<FONT COLOR="#000000">You will either get 1, or a TclError.</FONT>

<FONT COLOR="#000000">Also, I though you said latest tcl/tk versions but clearly tcl/tk</FONT>
<FONT COLOR="#000000">packages in Ubuntu 6.06 are not the latest.</FONT>
<FONT COLOR="#000000">But they also won't make a difference if you didn't recompile python</FONT>
<FONT COLOR="#000000">with these packages, I'm just telling this because right now Ubuntu</FONT>
<FONT COLOR="#000000">includes tcl/tk 8.5 but distributes python-tk compiled against tcl/tk</FONT>
<FONT COLOR="#000000">8.4.</FONT>

<FONT COLOR="#000000">Maybe you could include one example where this new module makes a</FONT>
<FONT COLOR="#000000">difference ? We could be talking about different things. For instance,</FONT>
<FONT COLOR="#000000">this:</FONT>

<FONT COLOR="#000000">import Tkinter</FONT>

<FONT COLOR="#000000">def test(text_widget):</FONT>
<FONT COLOR="#000000">    text_widget.config(text='abcdef')</FONT>

<FONT COLOR="#000000">def try_it(text_widget):</FONT>
<FONT COLOR="#000000">    threading.Thread(target=test, args=(text_widget, )).start()</FONT>

<FONT COLOR="#000000">lbl = Tkinter.Label()</FONT>
<FONT COLOR="#000000">lbl.pack()</FONT>
<FONT COLOR="#000000">lbl.after(10, lambda: try_it(lbl))</FONT>

<FONT COLOR="#000000">lbl.mainloop()</FONT>

<FONT COLOR="#000000">Would crash if tcl/tk were not compiled with --threads-enabled, but</FONT>
<FONT COLOR="#000000">then using your module it will run just fine.</FONT>

</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>