Skip to content

ScrollArea

phroun edited this page Aug 22, 2026 · 1 revision

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…"
	}
}

Properties

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.

Events

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.

One content trinket

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.

resizable

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.

Keys and mouse

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.

See also

Panel · ListView — scrolls its own rows · Splitter · Common Properties

Clone this wiki locally