Seite 1 von 1

Tkinter Title ändern

Verfasst: Sonntag 25. Mai 2014, 19:10
von HardwareManager
Ich möchte gerne den title von meinem tkinter Canvas GUI ändern.
Ich habe nur lösungen gefunden dir nicht gehen. :K

Re: Tkinter Title ändern

Verfasst: Sonntag 25. Mai 2014, 20:14
von BlackJack
@HardwareManager: Da gibt es eigentlich nur eine offensichtliche Lösung: die `title()`-Methode auf `Tk`- oder `Toplevel`-Exemplaren.

Re: Tkinter Title ändern

Verfasst: Montag 26. Mai 2014, 05:28
von Ene Uran
Hier mal ein Beispiel ...

Code: Alles auswählen

try:
    # Python2
    import Tkinter as tk
except ImportError:
    # Python3
    import tkinter as tk


def clicked():
    # change the window title
    root.title("Button1 clicked")

# one way to originally set the window title
root = tk.Tk(className="My Title")
root.geometry("300x120+200+50")

tk.Button(root, text="click on Button1", command=clicked).pack()

root.mainloop()