Hi Alan, thanks for the reply and my apologies for not realizing there was a Tkinter-discuss group.  After even more searching, this seems to be something weird with my version of Tkinter and/or my installation.  I can eliminate this effect on my machine (linux, python 2.6) by explicitly creating and destroying a toplevel window after the askdirectory() dialog, as such:<br>
<br>import tkFileDialog,tkMessageBox<br>import Tkinter<br>toplevel=Tkinter.Tk()<br>addDirectory=tkMessageBox.askyesno(&#39;a dialog&#39;,&#39;Add a directory?&#39;)<br>print addDirectory<br>theDirectory=tkFileDialog.askdirectory()<br>
toplevel.destroy()<br>addDirectory=tkMessageBox.askyesno(&#39;a dialog&#39;,&#39;Add a directory?&#39;)<br>print addDirectory<br><br>If I remove the &quot;toplevel.destroy()&quot; call, I get incorrect behavior.  However, if I run the same program on my windows installation (python 2.5), I get correct behavior regardless of the presence of this destroy() command, which I&#39;m pretty sure must be the expected behavior.  I will look into my tkinter version and file a bug report if I convince myself my install&#39;s not goofy- I get the same behavior with my 3.1 installation on my linux box.<br>
<br>Regarding teh print statements, I was using python 3 syntax but running python 2.6...I just like the 3 syntax better, sorry for the confusion.  The extra prints were just me getting carried away with debugging, I love printing stuff.<br>
<br>Kirk<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
&quot;Kirk Vander Meulen&quot; &lt;<a href="mailto:kvander11@gmail.com">kvander11@gmail.com</a>&gt; wrote<br>
<br>
&gt; I&#39;m working on a program partly to get the hang of gui programming.  I&#39;m<br>
&gt; a<br>
&gt; bit puzzled by the behavior of simple dialogs- I wonder why, in the<br>
&gt; following code, the second call to tkMessageBox.askyesno always returns<br>
&gt; &#39;False&#39; (either &#39;yes&#39; or &#39;no&#39; return False!).  If I take out the call to<br>
&gt; tkFileDialog.askdirectory(), the second call works as expected<br>
&gt; (yes-&gt;True,no-&gt;False).  I would really appreciate if someone could take a<br>
&gt; look at this and tell me what I&#39;m missing.  Thanks,<br>
<br>
After converting the imports for Python 3 it worked perfectly for me<br>
<br>
&gt;&gt;&gt; ================================ RESTART<br>
&gt;&gt;&gt; ================================<br>
&gt;&gt;&gt;<br>
True<br>
True<br>
H:/PROJECTS/Python/Tutor3<br>
True<br>
H:/PROJECTS/Python/Tutor3<br>
&gt;&gt;&gt; ================================ RESTART<br>
&gt;&gt;&gt; ================================<br>
&gt;&gt;&gt;<br>
<br>
&gt; import tkFileDialog,tkMessageBox<br>
&gt; addDirectory=tkMessageBox.askyesno(&#39;a dialog&#39;,&#39;Add a directory?&#39;)<br>
&gt; print(addDirectory)<br>
&gt; theDirectory=tkFileDialog.askdirectory()<br>
&gt; print(addDirectory)<br>
<br>
Any reason why you print it a second time even though there has been no<br>
change?<br>
<br>
&gt; print(theDirectory)<br>
&gt; addDirectory=tkMessageBox.askyesno(&#39;a dialog&#39;,&#39;Add a directory?&#39;)<br>
&gt; print(addDirectory)<br>
&gt; print(theDirectory)<br>
<br>
And the same here?<br>
<br>
<br>
--<br>
Alan Gauld<br>
Author of the Learn to Program web site<br>
<a href="http://www.alan-g.me.uk/" target="_blank">http://www.alan-g.me.uk/</a><br>
<br></blockquote></div>