>> Here is a very short example of creating two windows:
>>
>> >>> from Tkinter import *
>> >>> win = Tk()
>> >>> win1 = Toplevel(win)
>> >>> f = Frame(win)
>> >>> f.pack()
>> >>> g = Frame(win1)
>> >>> g.pack()
>> >>> Label(f,text="Main").pack()
>> >>> Label(g,text="Sub").pack()
>> >>> win.mainloop()

> If I close the 'main' window, 'sub' window will be closed too. How 
> can
> I close just one window?

You need to hide the main window (there must be one(*) but it can be
very small!) and then make all your visible windows Toplevels.

(*)That may not be true but I don't know of a way to avoid it...

Alan g. 

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to