许多网站声称“菜单小部件”有一个“字体”选项,但我一直无法设置它。系统是在Windows 8.1上运行的Python 3.5。脚本开始:
- from tkinter import *
- root = Tk()
- root.geometry('1400x800+120+40')
- .
- .
- menubar = Menu(root)
以下所有行均失败:
1. root.configure(font = ('Verdana',14))
2. root.option_add("*Font", ('Verdana', 14))
3. menubar = Menu(root, font = ('Verdana', 14))
4. menubar.configure(font = ('Verdana', 14))
5. menubar.add_command(label = "File", font = ('Verdana', 14))
6. default_font = Font.nametofont('Verdana')
7. default_font.configure(size = 14)
*Most of above give error " unknown option 'font' "*