PanedWindow
A themed container that stacks its children in resizable panes separated by draggable sashes.
Live preview
Drag the sash to resize the panes; the Theme switcher restyles them live:
Live preview. In the Player's built-in docs viewer (
scriptweaver --help), this rendersPanedWindowas a live, theme-aware widget you can interact with.
Example
const pw = app.PanedWindow({ orient: 'horizontal' });
pw.pack.configure({ fill: 'both', expand: true });
// Each pane is a child of the paned window, then added to it.
const list = pw.Frame({ width: 180 });
const detail = pw.Frame();
pw.add(list, { weight: 0 }); // fixed-ish sidebar
pw.add(detail, { weight: 1 }); // takes the extra space
list.Label({ text: 'Items' }).pack.configure({ anchor: 'w', padx: 8, pady: 8 });
detail.Label({ text: 'Details' }).pack.configure({ anchor: 'w', padx: 8, pady: 8 });
orient is fixed at creation time — set it in the constructor, not afterwards.
Methods
| Method | Description |
|---|---|
add(child, opts?) |
Add a pane. opts: weight (the child's pane weight). |
insert(index, child, opts?) |
Insert a pane at a position. |
forget(child) |
Remove a pane (the child widget is kept, just unmanaged). |
panes() |
The pane child paths, as an array. |
sashpos(index, pos?) |
Get or set a sash position in pixels (PanedWindow). |
add / insert / forget return the paned window, so calls chain. Plus the
inherited widget methods — see Widget basics.
Options
| Option | Type | Description |
|---|---|---|
orient |
string | 'horizontal' or 'vertical' (creation-time only). |
width / height |
number | Requested size in pixels. |
style |
string | A ttk style name (TPanedWindow only). |
The raw Tk panedwindow (via __native_tcl) adds sashWidth, sashRelief, showHandle,
opaqueResize, and background.