user101918
user101918

Reputation:

How do you set the default font for Tk widgets

I have a Tcl/Tk app that generates many forms and would like to be able to configure the default widget fonts from a central location without having to configure each widget with 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] --- "

Upvotes: 6

Views: 6984

Answers (1)

Dylan
Dylan

Reputation: 848

Try adding,

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

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

Upvotes: 13

Related Questions