<font color="#000000"><br></font><br><div class="gmail_quote">On Tue, Nov 15, 2011 at 12:32 AM, Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com">rosuav@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
As a general rule, if any parent is invisible, you won't see the<br>
child, and if any parent is disabled, you can't access the child. </blockquote><div><br>Yea, I'm becoming more familiar and comfortable with the GUI hierarchy as I play around. I do like how simple it is to test a concept in Tkinter (just a couple lines builds you a window with any kind of widget you want).<br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">You<br>
may find that there's even a one-line command that will disable the<br>
window, open a new window, wait for the new window to close, and<br>
automatically reenable the window - an "open modal dialog" function or<br>
something.<br></blockquote><div><br>Apparently I could not do what I was wanting to (state=DISABLED is not a valid option to Toplevel). What I wanted to do was something similar to what the dialogs were doing from tkMessageBox. The window didn't appear changed, but no buttons could be clicked. After looking through the tkMessageBox.py source code, I found the method I was looking for: grab_set. Essentially, I just have to have my new window call its grab_set() method to hog all events. Not really "disabling" the root window (which is why I had a hard time finding it on Google), but it's the exact behavior I was looking for. <a href="http://www.python-forum.org/pythonforum/viewtopic.php?f=15&t=4930">http://www.python-forum.org/pythonforum/viewtopic.php?f=15&t=4930</a> was helpful here.<br>
<br>The only other approach I (successfully) tried was to use the .withdraw() method on the window during the constructor of the *new* window and execute .deiconify() on it during the new window's destroy() method (before calling Toplevel's destroy on self). I still like the first way better.<br>
<br>Thanks!<br>Jason<br>
</div></div>