'''[https://www.tcl.tk/man/tcl/TkCmd/ttk_label.htm%|%ttk::label]''', a [Tk]
command, is the [ttk] analogue of [label].
** Documentation **
[https://www.tcl.tk/man/tcl/TkCmd/ttk_label.htm%|%official reference]:
** Description **
Kevin provides, on [comp.lang.tcl], a working example of automatic text wrapping using a [Tile] label
widget.
======
package require tile
ttk::label .l -text {This is a very long line of text that I hope will
dynamically wrap based upon the width of the widget.} -justify left -anchor w
grid .l -sticky ew
grid columnconfigure . 0 -weight 1
bind .l <Configure> {%W configure -wraplength [winfo width %W]}
======
**<<discussion>> Changing default font
[HaO] 2025-07-24: As the widget features a font **option, the default value may be set using the option data base:
[HaO] 2025-06-02: After a question on clt "Androwish Label Font", where there was a question, why:
======ttk::style configure TLabel -font Labelfont
======
does not work.
I have no reason, but I worked this out 10 years ago.
My solution at this time was to use the option data base:
======
option add *TLabel.font LabelFont
======<<enddiscussion>>
If someone has a better answer, please post it and remove the upper "workaround".
** Questions **
[Lars H], 2015-12-26: I just tried using a ttk::label to display a mutable [image] in a GUI, but was surprised to see a delay of over a second between changing the underlying image and seeing the widget display the modified image! (Other parts of the GUI updated fine, so program had finished changing the image and control had returned to the event loop.) Using a plain Tk [label] for the widget seemed to get rid of this delay, however. Is this a known behaviour? A consequence of the theming mechanisms?
<<categories>> Widget