LabelFrame
A Frame with a title drawn into its border — handy for visually
grouping related controls. TLabelFrame is the themed version (preferred);
LabelFrame is the classic one.
Example
const box = app.TLabelFrame({ text: 'Connection', padding: 10 });
box.pack.configure({ fill: 'x', padx: 12, pady: 12 });
box.TLabel({ text: 'Host' }).grid.configure({ row: 0, column: 0, sticky: 'w' });
box.TEntry().grid.configure({ row: 0, column: 1, padx: 6 });
box.TCheckButton({ text: 'Use TLS' }).grid.configure({ row: 1, column: 0, columnspan: 2, sticky: 'w' });
Like any frame, a LabelFrame is a
container: create children with
its factory methods and lay them out inside it.
Options
| Option | Type | Description |
|---|---|---|
text |
string | The title shown in the border. |
labelAnchor |
string | Where the title sits: 'nw', 'n', 'ne', 'w', … |
labelWidget |
widget | Use another widget (e.g. a TCheckButton) as the title instead of text. |
padding |
number / list | Inner padding (TLabelFrame only). |
width / height |
number | Requested size in pixels. |
style |
string | A ttk style name (TLabelFrame only). |
The classic LabelFrame also takes background, foreground, font,
borderWidth, relief, and padX / padY instead of padding.
Methods
LabelFrame has no commands of its own; use the inherited widget methods plus the
container factory methods. See Widget basics.