Question

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] --- "
Was it helpful?

Solution

Try adding,

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top