繁体   English   中英

如何设置Tk小部件的默认字体

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM