nimterm/widgets/scroll
This page is generated from the module’s exported API and ## documentation comments.
Shared viewport state for vertically scrollable widgets.
ScrollView
Section titled “ScrollView”ScrollView = object contentHeight*: int viewportHeight*: int offset*: int followTail*: boolProcedures
Section titled “Procedures”newScrollView
Section titled “newScrollView”proc newScrollView(followTail = true): ScrollView {.raises: [], tags: [], forbids: [].}Returns: ScrollView.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
followTail |
inferred |
true |
maxOffset
Section titled “maxOffset”proc maxOffset(view: ScrollView): int {.raises: [], tags: [], forbids: [].}Returns: int.
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
view |
ScrollView |
update
Section titled “update”proc update(view: var ScrollView; contentHeight, viewportHeight: int) {. raises: [], tags: [], forbids: [].}Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
view |
var ScrollView |
|
contentHeight |
int |
|
viewportHeight |
int |
scrollBy
Section titled “scrollBy”proc scrollBy(view: var ScrollView; lines: int) {.raises: [], tags: [], forbids: [].}Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
view |
var ScrollView |
|
lines |
int |
pageBy
Section titled “pageBy”proc pageBy(view: var ScrollView; pages: int) {.raises: [], tags: [], forbids: [].}Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
view |
var ScrollView |
|
pages |
int |
proc home(view: var ScrollView) {.raises: [], tags: [], forbids: [].}Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
view |
var ScrollView |
proc tail(view: var ScrollView) {.raises: [], tags: [], forbids: [].}Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
view |
var ScrollView |
visibleRange
Section titled “visibleRange”proc visibleRange(view: ScrollView): Slice[int] {.raises: [], tags: [], forbids: [].}Returns: Slice[int].
Arguments
Section titled “Arguments”| Name | Type | Default |
|---|---|---|
view |
ScrollView |