import tkinter as tk
from tkinter import ttk
win=tk.Tk()
win.title('GUI004')
aLabel=ttk.Label(win,text='A Label')
aLabel.grid(column=0,row=0)
def clickme():
action.configure(text='*I have been clicked!')
aLabel.configure(foreground='red')
action=ttk.Button(win,text='Click Me',command=clickme)
action.grid(column=1,row=0)
win.mainloop()
网友评论