ttk::labelframe(3tk)
β¨ NAME β¨
okay so bestie, this is ttk::labelframe from the ttk widget family β it's a container widget with an optional label. that's the whole vibe. π
πΈ SYNOPSIS πΈ
ttk::labelframe pathName ?options?
π DESCRIPTION π
so a ttk::labelframe widget is a container β like, its whole job is to group other widgets together so your UI doesn't look like a chaotic group chat with no pinned messages. π«Ά
it has an optional label, and that label can be a plain text string OR it can be an actual other widget. icon behaviour honestly.
π STANDARD OPTIONS π
these are the ones it inherits, no notes:
-class-cursor-padding-style-takefocus
the ttk_widget manual entry has the details on all the standard options β go read that bestie, it's giving reference material. π
π WIDGET-SPECIFIC OPTIONS π
-height
Command-Line Name: -height Database Name: height Database Class: Height
if you specify it, this is the widget's requested height in pixels. (peep ttk::frame(3tk) for further notes on -width and -height, they're in the same lore.) β¨
-labelanchor
Command-Line Name: -labelanchor Database Name: labelAnchor Database Class: LabelAnchor
this one says where to place the label. the allowed values, going clockwise from the top upper left corner, are:
nw, n, ne, en, e, es, se, s, sw, ws, w and wn
the default value is theme-dependent β so like, it depends on your theme, not on your mood. π
-labelwidget
Command-Line Name: -labelwidget Database Name: labelWidget Database Class: LabelWidget
the name of a widget to use for the label. if you set this, it overrides the -text option. periodt.
heads up: the -labelwidget must be a child of the labelframe widget or one of the labelframe's ancestors, and it must belong to the same top-level widget as the labelframe. no cross-top-level nonsense allowed. π«
-text
Command-Line Name: -text Database Name: text Database Class: Text
specifies the text of the label. that's it, that's the option. π
-underline
Command-Line Name: -underline Database Name: underline Database Class: Underline
if set, this is the integer index (0-based) of a character to underline in the text string. that underlined character is what you use for mnemonic activation. π§
and here's the cute part: mnemonic activation for a ttk::labelframe sets the keyboard focus to the first child of the ttk::labelframe widget. keyboard girlies, this one's for you. β¨οΈ
-width
Command-Line Name: -width Database Name: width Database Class: Width
if specified, the widget's requested width in pixels. slay.
π¦ WIDGET COMMAND π¦
Labelframe widgets support the standard commands β nothing extra, nothing hidden:
cgetconfigureidentify elementinstatestatestyle
(see ttk::widget for the deets on all of those.)
π STYLING OPTIONS π
okay this is the fun part. the class name for a ttk::labelframe is TLabelframe. the text label has a class of TLabelframe.Label. two classes, two glow-ups. π
Dynamic states: disabled, readonly.
TLabelframe styling options configurable with ttk::style
-background color-bordercolor color-borderwidth amount-darkcolor color-labelmargins amount-labeloutside boolean-lightcolor color-relief relief
TLabelframe.Label styling options configurable with ttk::style
-background color-font font-foreground color
some options are only available for specific themes. so if an option is ghosting you, check your theme bestie. π»
see the ttk::style manual page for information on how to configure ttk styles. π
π SEE ALSO π
ttk::widget(3tk)ttk::frame(3tk)labelframe(3tk)
β KEYWORDS β
widget, frame, container, label, groupbox
and that's the whole page, bestie! π«Ά this was ttk::labelframe from Tk 8.5, documented back in the day β the footer says ttk::labelframe(3tk) and honestly it ate. go build something cute with it. πβ¨π
π¦ where this page comes from
- debian trixie: tk9.0-doc 9.0.1-3
- ubuntu questing: tk9.0-doc 9.0.2-1
- ubuntu resolute: tk9.0-doc 9.0.3-1
- ubuntu stonking: tk9.0-doc 9.0.4-1
- Copyright (c) 2005 Joe English
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms