Skip to content

nimterm/widgets/scroll

This page is generated from the module’s exported API and ## documentation comments.

Shared viewport state for vertically scrollable widgets.

ScrollView = object
contentHeight*: int
viewportHeight*: int
offset*: int
followTail*: bool

View source

proc newScrollView(followTail = true): ScrollView {.raises: [], tags: [],
forbids: [].}

Returns: ScrollView.

Name Type Default
followTail inferred true

View source

proc maxOffset(view: ScrollView): int {.raises: [], tags: [], forbids: [].}

Returns: int.

Name Type Default
view ScrollView

View source

proc update(view: var ScrollView; contentHeight, viewportHeight: int) {.
raises: [], tags: [], forbids: [].}
Name Type Default
view var ScrollView
contentHeight int
viewportHeight int

View source

proc scrollBy(view: var ScrollView; lines: int) {.raises: [], tags: [],
forbids: [].}
Name Type Default
view var ScrollView
lines int

View source

proc pageBy(view: var ScrollView; pages: int) {.raises: [], tags: [],
forbids: [].}
Name Type Default
view var ScrollView
pages int

View source

proc home(view: var ScrollView) {.raises: [], tags: [], forbids: [].}
Name Type Default
view var ScrollView

View source

proc tail(view: var ScrollView) {.raises: [], tags: [], forbids: [].}
Name Type Default
view var ScrollView

View source

proc visibleRange(view: ScrollView): Slice[int] {.raises: [], tags: [],
forbids: [].}

Returns: Slice[int].

Name Type Default
view ScrollView

View source