Tk's default Toplevel - counterintuitive

Gary Herron gherron at
Fri Aug 20 01:02:29 CEST 1999

Stuart Reynolds wrote:
> Does anyone know how to tell if Tk has already instaniated a Toplevel
> window? I want to be able to open several Toplevel windows in any order.

Perhaps the easiest way is to never use the default top level window:

from Tkinter import *
DefaultTop = Tk()
DefaultTop.withdraw()  # Never to be seen 

def makeNewWindow():
   mstr = Toplevel()
   f = Frame(master=mstr)

You can still do
when it time to turn control over to the main event loop

Dr. Gary Herron <gherron at>
Alias | Wavefront
1218 3rd Ave, Suite 800, Seattle WA 98101

More information about the Python-list mailing list