How to set the default font for Tk widgets

I have a Tcl / Tk application that generates many forms and wants to be able to customize the default widget fonts from a central location without having to configure each widget using the -font switch.

 #!<path>/wish button .hello -text "Hello, World!" -command { exit } pack .hello puts "--- i would like to set this thing: [.hello configure -font] --- " 
+4
source share
1 answer

Try to add

 font create myDefaultFont -family Helvetica -size 20 option add *font myDefaultFont 

at the top of your script. (link to the article about fonts)

+10
source

All Articles