2010-03-17 82 views

回答

2

一個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