Frame

A rectangular container that groups and lays out other widgets. TFrame is the themed version (preferred); Frame is the classic one.

Example

const card = app.TFrame({ padding: 12 });
card.pack.configure({ fill: 'x', padx: 8, pady: 8 });

card.TLabel({ text: 'Settings' }).pack.configure({ anchor: 'w' });
card.TButton({ text: 'Edit' }).pack.configure({ anchor: 'e' });

A frame is a container: create children with its factory methods (card.TLabel(…), card.TButton(…), …) and lay them out inside it.

Options

Option Type Description
padding number / list Inner padding (one value, or [left, top, right, bottom]).
borderWidth number Border thickness.
relief string Border style: 'flat', 'groove', 'raised', …
width / height number Requested size in pixels.
style string A ttk style name (TFrame only).

The classic Frame also takes background.

Methods

Frame has no commands of its own; use the inherited widget methods plus the container factory methods. See Widget basics.

See also