0

I am trying to set specific font styles to different types of widgets using the root.option_add() method.

For example:

root.option_add('*font', ('Courier New', 9)) # apply monospace font to all widgets

root.option_add('*Button.font', ('Courier New', 10, 'bold')) # buttons have larger, bold font
root.option_add('*Labelframe.font', ('Courier New', 11, 'bold')) # labelframes have larger, bold font
root.option_add('*Optionmenu.font', ('Courier New', 12, 'bold')) # optionmenus have larger, bold font
root.option_add('*Menubar.font', ('TkDefaultFont', 9)) # menubar commands use tk default font

I found '*font' was possible on this post and setting specific '*widget.font' was possible on this post.

I was able to make the '*Button.font' and '*Labelframe.font' work with a little bit of guessing at the name, but I can't figure how to make the '*Optionmenu.font' or '*Menubar.font' ones to work. I suspect I am just using the wrong keyword in those places, but I haven't been able to find any documentation about this feature or how to use it.

Is there any documentation about what needs to be placed between * and .font for each different widget?

0 Answers0