Python Tkinter Title issue -
every time write in title tkinter creates new window instead of adding title frame. using root.title('') tk stays @ top of main window
you use tk()
2 times - first root = tk.tk()
, second sampleapp(tk.tk)
.
if create class using tk
don't need root = tk.tk()
simple example
import tkinter tk class sampleapp(tk.tk): def __init__(self, *args, **kwargs): tk.tk.__init__(self, *args, **kwargs) self.title("the title") tk.label(self, text="hello world of tkinter").pack() sampleapp().mainloop()
btw: if need second window use toplevel
Comments
Post a Comment