我想在 ttk.notebook python 3x 中更改选项卡标题的字体、宽度和高度
通过下面的代码,我可以更改选项卡标题框的宽度
text=f'{"frame 1": ^30s}
但是如何更改“第 1 帧”的字体以及选项卡标题框的高度?
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
notebook = ttk.Notebook(root)
f1 = tk.Frame(notebook, bg='red', width=200, height=200)
f2 = tk.Frame(notebook, bg='blue', width=200, height=200)
notebook.add(f1, text=f'{"frame 1": ^30s}')
notebook.add(f2, text=f'{"frame 2 longer": ^30s}')
notebook.grid(row=0, column=0, sticky="nw")
root.mainloop()
相关分类