-
Notifications
You must be signed in to change notification settings - Fork 0
ScrollArea
Wire name scrollarea
A viewport onto content larger than itself, with scrollbars.
sa=new scrollarea children={
new panel layout=vbox children={
new label caption="…many rows…"
}
}
| Property | Type | Default | Meaning |
|---|---|---|---|
resizable |
flag | false |
Content tracks viewport width |
scroll_x |
int | — | Horizontal scroll offset |
scroll_y |
int | — | Vertical scroll offset |
Plus the common properties.
scroll_x and scroll_y are offsets in units, and set
where the viewport currently sits.
scrollarea emits no events.
Scrolling raises nothing. The position is state an application can set and the user can move; nothing reports the movement back.
The same rule as Window and a tab:
new scrollarea children={ new label caption="a"; new label caption="b" }
-> scrollarea: only one content trinket (wrap several in a panel)
So a scroll area's child is usually a Panel holding the rest.
By default the content keeps its own width and scrolls horizontally when it
does not fit. resizable makes the content track the viewport's width
instead, so it re-wraps rather than scrolling sideways — what a page of
word-wrapped text wants, and what a wide table does not.
| Does | |
|---|---|
| Wheel | Scroll vertically. |
| Drag a scrollbar | Scroll along that axis. |
| Drag past the edge | Auto-scrolls while the pointer is held out there. |
The scroll area takes focus by Tab and by click.
Panel · ListView — scrolls its own rows · Splitter · Common Properties
KittyTK — image/tty Trinket Kit · MIT licensed · alpha, 0.1.x
Repository · Issues · Support on ko-fi
Sibling projects: PurfecTerm (terminal emulator) · mew (text editor) · PawScript (language)
Getting Started
Installation Building from Source Running a Display Host Your First Application Examples
Protocol
Protocol Overview Object Model Properties and Values Events Templates and Aliases Common Properties Introspection Transports and Security
Clients
Go Client Python Client C Client
Application Objects
Application · MenuBar · Window · MessageBox
Output Trinkets
Label · ProgressBar · StatusBar
Input Trinkets
TextInput · Editor · Terminal
Button · CheckBox · RadioButton
ListView · ComboBox · TreeView
Layout Trinkets
TabTrinket · Panel
ScrollArea · MDIPane
Separator · Spacer · Splitter
Other Trinkets
Layout Helpers