ttk::label(n)
π ttk::label(n) β the Tk Themed Widget glow-up π
ok so bestie, welcome to ttk::label, the themed label widget. She's in the Tk family, manual section n, and honestly? she's that girl. Let's get into it β¨
πΈ NAME πΈ
ttk::label β display a text string and/or image. That's it, that's the whole job, and she does it beautifully π
π¦ SYNOPSIS π¦
ttk::label pathName ?options?
literally just give her a pathName and optionally some options and you're good to go π«Ά
π DESCRIPTION π
A ttk::label widget displays a textual label and/or image β no cap, that's her whole moment. And here's the iconic part: the label can be linked to a Tcl variable so the displayed text updates automatically. set the variable, the label changes, you don't lift a finger. main character energy fr fr π
β STANDARD OPTIONS β
these are the standard faves β same energy as every ttk widget:
-anchor-class-compound-cursor-font-foreground-image-justify-padding-state-style-takefocus-text-textvariable-underline-width-wraplength
π heads up bestie: check the ttk_widget manual entry for the full deets on all these standard options. iykyk.
π₯ WIDGET-SPECIFIC OPTIONS π₯
these are the ones that are hers, and they're giving very much custom π
-background(database nameframeColor, database classFrameColor) β the widget's background color. If you don't specify it, the theme default is used. no stress, the theme has you π-relief(database namerelief, database classRelief) β specifies the 3-D effect you want for the widget border. valid values areflat,groove,raised,ridge,solid, andsunken. pick your vibe π-wraplength(database namewrapLength, database classWrapLength) β specifies the maximum line length (in pixels). if this option is negative or zero, then automatic wrapping is not performed; otherwise the text is split into lines such that no line is longer than the specified value. so basically: give her a number and she'll wrap for you, give her zero or negative and she's not wrapping, periodt βοΈ
π WIDGET COMMAND π
label widgets support the standard commands β cget, configure, identify element, instate, state and style. that's the squad. see ttk::widget for the details π«Ά
π STYLING OPTIONS π
the class name for a ttk::label is TLabel. remember that name, she answers to it π
dynamic states: disabled, readonly.
TLabel styling options configurable with ttk::style are:
-backgroundcolor-compoundcompound-foregroundcolor-fontfont
π¦ some options are only available for specific themes β so if something's not showing up, it might just be your theme being picky, ngl.
see the ttk::style manual page for info on how to configure ttk styles β¨
π§ SEE ALSO π§
ttk::widget(n)label(n)
and that's the page bestie!! π this whole thing is from Tk version 8.5, dated back whenever this page was minted β so if you're running an older Tk, that's why some things might feel a little vintage. go forth and label slay π πβ¨
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- Copyright (c) 2004 Joe English
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms