0
很多網站都說Menu小部件有'font'選項,但是我一直無法設置它。系統是在Windows 8.1中運行的Python 3.5。腳本開始:python tkinter菜單,如何更改字體?
- 從Tkinter的進口*
- 根= Tk的()
- root.geometry( '1400x800 + 120 + 40')
- 。
- 。
- 菜單欄=菜單(根)
所有的線下面都失敗了:
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' "*
這個問題被問到[這裏](http://stackoverflow.com/questions/31925771/python-tkinter-how-to-modify-the-font-of-the-menu-widget)沒有答案,但它看起來不可能在Windows和OSX上更改菜單字體。 – scotty3785