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 59
Returns the total content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 67
Sets the total content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 91
Scrolls to the first position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 99
Scrolls to the last position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 35
Creates a new ScrollbarState with the given content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 107
Scrolls to the next position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 43
Returns the current scroll position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 51
Sets the current scroll position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 115
Scrolls to the previous position.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 75
Returns the viewport content length.
(Native method implemented in Rust)
Source
# File lib/ratatui_ruby/scrollbar_state.rb, line 83
Sets the viewport content length.
(Native method implemented in Rust)