Is it possible to make the size of the text in the ttk:button bigger?
I've tried setting the global font size but only makes the label texts
size bigger.
option add *font "Helvetica 20"
M.
style configure Big.TButton -font {Helvetica 60}
toplevel .t
pack [ttk::button .t.t -style Big.TButton -text "Tile Rocks!"]
/Mats
Thanks Mats, is working nicely.
style configure Big.TButton -font {Helvetica 20} -background red -
foreground white
proc makeKeyboard { keySet } {
set keyboard [ttk::frame $::BASE.keyboard]
for {set row 0} {$row < 4} {incr row} {
grid rowconfigure $keyboard $row -weight 1 -uniform buttons -
minsize 50
for {set col 0} {$col < 8} {incr col} {
if {!$row} {
grid columnconfigure $keyboard $col -weight 1 -uniform
buttons -minsize 50
}
set key [lindex [lindex $keySet $row] $col]
grid [ttk::button $keyboard.b$row$col -takefocus 0 -style
Big.TButton -text $key -command [list keyAction $key]] \
-row $row -column $col -sticky snew
}
}
$::pw add $keyboard
}
I've set the text and background of the buttons in my program. How can
I set the button color? I thought it was using the -background option
but this sets the background of the button itself.
M.
Most Tile widgets (ttk::button included) do not have
a "-font" option, so option database settings have no
effect.
You can change the default font size for all widgets by
modifying the named font TkDefaultFont:
font configure TkDefaultFont -size 20
or for button widgets only by changing the style database:
ttk::style configure TButton -font "Helvetica 20"
--Joe English