# -*- coding: utf-8 -*- import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() root.title("tk22.py") root.geometry("200x120") ##################################### def fun(event): ttkLb1.config(text = "You just click.") ttk.Style().configure('A.TLabel',padding = 5, relief = 'groove', background = 'pink', foreground = 'blue') ttk.Style().configure('A.TButton',padding = 5, relief = 'raised', background = 'gold', foreground = 'red') ttkLb1 = ttk.Label(root, text = "This is a Label.", style = 'A.TLabel') ttkBtn1 = ttk.Button(root, text = "ttk Button_1", style = 'A.TButton') ttkLb1.pack() ttkBtn1.pack(side = tk.BOTTOM) ttkBtn1.bind("<1>", fun) ##################################### root.mainloop()