[英]How do you set the default font for Tk widgets
我有一个生成许多表单的Tcl / Tk应用程序,并且希望能够从中央位置配置默认小部件字体,而无需使用-font
开关配置每个小部件。
#!<path>/wish
button .hello -text "Hello, World!" -command { exit }
pack .hello
puts "--- i would like to set this thing: [.hello configure -font] --- "
尝试添加,
font create myDefaultFont -family Helvetica -size 20
option add *font myDefaultFont
到你的脚本的顶部。 (链接到字体上的文章)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.