如何更改主题按钮小部件(ttk::button)中的字体和字体大小?
ttk::button .x.buttonTEST -text "TEST" -font ??
# the -font option is not valid with ttk::button发布于 2010-03-26 00:19:36
ttk::按钮的外观(特别是对您来说,它的字体,但也包括其他东西)是通过样式和主题来控制的。只需设置一次样式,就可以轻松地将其应用于多个按钮(假设这就是您想要的)。
要做到这一点,最简单的方法是创建一个派生样式,这是通过在现有的基本样式(按钮为TButton)上添加一些自定义前缀来完成的。
# Once per style in your program...
ttk::style configure MyExample.TButton -font {Symbol 48}
# For each button you want that looks this way...
ttk::button .b -font "Example" -style MyExample.TButton
pack .b发布于 2010-03-18 00:43:32
你可能会在这个Tk教程页面上找到你想要的答案:http://www.tkdocs.com/tutorial/styles.html
https://stackoverflow.com/questions/2463565
复制相似问题