class RatatuiRuby::ScrollbarState
Mutable state object for Scrollbar widgets.
When using {Frame#render_stateful_widget}, the State object is the *single source of truth* for position and content length. Widget properties (position, content_length) are ignored in stateful mode.
Example
@scrollbar_state = RatatuiRuby::ScrollbarState.new(100) @scrollbar_state.position = 25 RatatuiRuby.draw do |frame| scrollbar = RatatuiRuby::Scrollbar.new(orientation: :vertical_right) frame.render_stateful_widget(scrollbar, frame.area, @scrollbar_state) end
Public Instance Methods
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 49
Returns the total content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 57
Sets the total content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 81
Scrolls to the first position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 89
Scrolls to the last position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 25
Creates a new ScrollbarState with the given content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 97
Scrolls to the next position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 33
Returns the current scroll position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 41
Sets the current scroll position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 105
Scrolls to the previous position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 65
Returns the viewport content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 73
Sets the viewport content length.
(Native method implemented in Rust)