I thought the line to change the title of a window was:
tk=Tk()
tk.title="my title"
But I can't get the title to change in my code:
def welcome_screen():
#creates the login window
window = Tk()
window.title = "Login Screen"
window.geometry("960x540+450+250")
canvas = Canvas(window, width=960, height=540, bd=10, bg='#494949')
canvas.pack()
window.mainloop()
welcome_screen()
The title should change to "login screen" but when run it just says 'tk'. everything else works as expected.
title is a function. Use it like:
root.title("My new title")
Example:
root = Tk()
root.title("my title")
root.mainloop()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With