LabelFrame

A themed Frame with a title drawn into its border — handy for visually grouping related controls.

Live preview

Try the Theme switcher in the toolbar — this preview restyles live:

Live preview. In the Player's built-in docs viewer (scriptweaver --help), this renders LabelFrame as a live, theme-aware widget you can interact with.

Example

const box = app.LabelFrame({ text: 'Connection', padding: 10 });
box.pack.configure({ fill: 'x', padx: 12, pady: 12 });

box.Label({ text: 'Host' }).grid.configure({ row: 0, column: 0, sticky: 'w' });
box.Entry().grid.configure({ row: 0, column: 1, padx: 6 });
box.CheckButton({ 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 CheckButton) 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 raw Tk labelframe (via __native_tcl) 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.

See also