label .l -text "Foo"
pack .l
.l configure -font [concat [.l cget -font] [concat underline]]
How does one achieve the same effect in Tile? ttk::label has a -font
option but it seems to always return an empty string so I can't figure
out what font and size it is using. I tried looking at the TLabel
layout and configuration but nothing related to fonts showed up there
either.
Thanks in advance,
/Ashok
> I want to create a Tile style where labels use the default font but are
> underlined.
You can try something like:
set family [font configure TkTextFont -family]
set size [font configure TkTextFont -size]
font create underFont -family $family -size $size -underline 1
set a [ttk::label .a -font underFont -textvariable hi]
set hi Hello
pack $a
As for the font to use as a starting point, you have:
# TkDefaultFont -- default for GUI items not otherwise specified
# TkTextFont -- font for user text (entry, listbox, others).
# TkHeadingFont -- headings (column headings, etc)
# TkCaptionFont -- dialog captions (primary text in alert dialogs, etc.)
# TkTooltipFont -- font to use for tooltip windows
Andres
The tile widgets use symbolic fonts defined in
$tile::library/fonts.tcl, usually TkDefaultFont.
--Joe English