# -*- coding: utf-8 -*- import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() root.title("tk23.py") root.geometry("250x200") ##################################### def fa(): aLb.config(text = 'Button clicked.') def fb(): bLb.config(text = 'Button clicked.') ttk.Style().configure('TLabel', background = 'pink', foreground = 'blue', relief = 'sunken') ttk.Style().configure('TButton', background = 'gold', foreground = 'red', relief = 'raised') ttk.Style().configure('TFrame', borderwidth = 0, background = 'lightgreen') nb = ttk.Notebook(root) frame_Apple = ttk.Frame(nb, style = 'TFrame') nb.add(frame_Apple, text = 'Apple') aLb = ttk.Label(frame_Apple, text = "Apple", style = 'TLabel') aBtn = ttk.Button(frame_Apple, text = 'AButton', style = 'TButton', command = fa) frame_Banana = ttk.Frame(nb, style = 'TFrame') nb.add(frame_Banana, text = 'Banana') bLb = ttk.Label(frame_Banana, text = "Banana", style = 'TLabel') bBtn = ttk.Button(frame_Banana, text = 'BButton', style = 'TButton', command = fb) nb.pack() aLb.pack() aBtn.pack() bLb.pack() bBtn.pack() ##################################### root.mainloop()