struct TUI::ScrollControl

Overview

A narrow handle onto a Window's Scroller, handed to Scrollable content so it can drive scrolling (reveal-on-select, page up/down, wheel ticks) without owning the Scroller itself or knowing its own viewport size beyond what's captured here at construction time.

Defined in:

tui/widget/scroll_control.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(scroller : Scroller, visible : Int32) #

[View source]

Instance Method Detail

def down(by : Int32 = 1, total : Int32 = Int32::MAX) : Nil #

[View source]
def offset : Int32 #

[View source]
def reset : Nil #

[View source]
def reveal(index : Int32) : Nil #

[View source]
def up(by : Int32 = 1) : Nil #

[View source]
def visible : Int32 #

The viewport size this control was constructed with — content uses this as the page-size for PageUp/PageDown (matching what Window itself measured as the visible content area for this frame).


[View source]
def wheel_down(by : Int32 = Scroller::WHEEL_STEP, total : Int32 = Int32::MAX) : Nil #

[View source]
def wheel_up(by : Int32 = Scroller::WHEEL_STEP) : Nil #

[View source]