ttk::label(3tk)

πŸ“¦
version 9.0.4 Β· 3 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– ttk::label β€” the manual, but make it cute πŸ’–

okay bestie, sit down, hydrate, and let me tell you about ttk::label, a themed widget from the Tk toolkit (this is the ttk::label(3tk) page, mwah πŸ’…).


✨ NAME ✨

ttk::label β€” display a text string and/or image. that's it. that's the whole job. and she does it flawlessly. πŸ‘‘


🌸 SYNOPSIS 🌸

ttk::label pathName ?options?

πŸ¦‹ DESCRIPTION πŸ¦‹

A ttk::label widget shows a textual label and/or an image. literally a glow-up for your text, no cap. πŸ’–

and here's the iconic part: the label can be linked to a Tcl variable so the displayed text changes automatically. main character behavior. she updates herself. periodt. ✨


πŸŽ€ STANDARD OPTIONS πŸŽ€

these are the standard girlies, the whole squad:

  • -anchor
  • -class
  • -compound
  • -cursor
  • -font
  • -foreground
  • -image
  • -justify
  • -padding
  • -state
  • -style
  • -takefocus
  • -text
  • -textvariable
  • -underline
  • -width
  • -wraplength
psst β€” for the full deets on any of these, go read the ttk_widget manual entry. she's got the lore. πŸ“–

πŸ’… WIDGET-SPECIFIC OPTIONS πŸ’…

these ones are hers. custom. exclusive. iykyk. 🫢

-background

  • Command-Line Name: -background
  • Database Name: frameColor
  • Database Class: FrameColor

the widget's background color. if you don't specify it, the theme default gets used. let the theme cook. πŸ“

-relief

  • Command-Line Name: -relief
  • Database Name: relief
  • Database Class: Relief

specifies the 3-D effect you want for the widget border. the valid values are: flat, groove, raised, ridge, solid, and sunken. pick your vibe, bestie. ✨

-wraplength

  • Command-Line Name: -wraplength
  • Database Name: wrapLength
  • Database Class: WrapLength

specifies the maximum line length, in pixels. if this option is negative or zero, then automatic wrapping is not performed β€” no wrapping, she just goes off the edge, iconic but chaotic 😭. otherwise the text gets split into lines such that no line is longer than the value you specified. 🧚


πŸ‘‘ WIDGET COMMAND πŸ‘‘

label widgets support the standard commands cget, configure, identify element, instate, state and style. (check ttk::widget for those β€” she's the source of truth. πŸ’œ)


🌈 STYLING OPTIONS 🌈

the class name for a ttk::label is TLabel.

Dynamic states: disabled, readonly.

TLabel styling options you can configure with ttk::style are:

  • -background color
  • -compound compound
  • -foreground color
  • -font font
heads up bestie: some options are only available for specific themes. not every theme comes with the full closet. πŸ‘—

for the full tea on how to configure ttk styles, see the ttk::style manual page.


πŸ”₯ SEE ALSO πŸ”₯


πŸ’– cute sign-off πŸ’–

that's the whole page, bestie β€” this manual is from Tk 8.5, and it's filed under ttk::label(3tk). go forth and label things beautifully. slay, ate, no crumbs. πŸŒŸπŸ’…πŸ¦‹

πŸ“¦ where this page comes from