PanedWindow
A container that stacks its children in resizable panes separated by draggable
sashes. TPanedWindow is the themed version (preferred); PanedWindow is the
classic one.
Example
const pw = app.TPanedWindow({ 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.TFrame({ width: 180 });
const detail = pw.TFrame();
pw.add(list, { weight: 0 }); // fixed-ish sidebar
pw.add(detail, { weight: 1 }); // takes the extra space
list.TLabel({ text: 'Items' }).pack.configure({ anchor: 'w', padx: 8, pady: 8 });
detail.TLabel({ 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 (ttk); classic takes minsize, sticky, … |
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 (TPanedWindow). |
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 classic PanedWindow adds sashWidth, sashRelief, showHandle,
opaqueResize, and background.