TNotebook
A tabbed container. Each tab shows one child widget (usually a
TFrame).
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 rendersTNotebookas a live, theme-aware widget you can interact with.
Example
const nb = app.TNotebook();
nb.pack.configure({ fill: 'both', expand: true });
const general = nb.TFrame({ padding: 12 });
const advanced = nb.TFrame({ padding: 12 });
nb.add(general, { text: 'General' });
nb.add(advanced, { text: 'Advanced' });
general.TLabel({ text: 'General settings' }).pack.configure();
Create each page as a child of the notebook (nb.TFrame()), then add it.
Methods
| Method | Description |
|---|---|
add(child, opts?) |
Add a tab showing child. opts: text, image, … |
insert(index, child, opts?) |
Insert a tab at a position. |
select(tab?) |
Select a tab (by child or index), or get the current one. |
tab(tab, opts) |
Configure a tab (e.g. { text }, { state }). |
forget(tab) / hide(tab) |
Remove / hide a tab. |
index(tab) |
A tab's numeric index; index('end') is the tab count. |
tabs() |
The tab child paths. |
Plus the inherited widget methods — see Widget basics.
See also
- The preferences dialog example
- Frame
- Layout