Is it necessary to call Tk() when writing a GUI app with Tkinter?

John Salerno johnjsal at gmail.com
Thu Mar 1 01:14:41 EST 2012


> What exactly is the purpose of doing that? Does Tk do some extra work that a simple call to Frame won't do?

More specifically, what is the benefit of doing:
root = tk.Tk()
app = Application(master=root)
app.mainloop()
as opposed to:
app = Application()
app.mainloop()
Also, in the first example, what is the difference between calling app.mainloop() and root.mainloop()? They both seemed to work when I ran them.


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /