[Tutor] a question related to modal in Tkinter

alan.gauld@bt.com alan.gauld@bt.com
Tue Jan 21 09:18:03 2003


> How can I make some a Toplevel object a REAL modal window?
> Please try to the following codes, and you will see what I am 
> talking about.
> 
> The second Toplevel object created in the program actually 
> comes IN FRONT of the the first Toplevel object I tried to 
> make modal. Could someone please tell me why?  

Presumably you pressed the button in your initial top 
level window?

Could you define what you think modal implies? Top me it 
implies that you can't do anything with the parent window 
while the modal child is active. Howevber it does not prevent 
you from creating child windows(whether modal or not) 
from that initial modal window.

> Is there a way to overcome this, and insure that the first 
> Toplevel object is modal?

So far as I can see it is Modal. Or do you mean that you can 
still press the original button and bring up a second copy 
of the original window? - Sorry my python at work doesn't 
have Tkinter installed so I can't try the code...
(Its also v1.3!)

Alan g.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld/