module RatatuiRuby::TUI::Core
Core terminal methods delegated to RatatuiRuby module.
These are the fundamental operations for the render loop: drawing UI, polling events, and inspecting the buffer.
Public Instance Methods
Source
# File lib/ratatui_ruby/tui/core.rb, line 17 def draw(tree = nil, &block) if tree && block raise ArgumentError, "Cannot provide both a tree and a block to draw" end unless tree || block raise ArgumentError, "Must provide either a tree or a block to draw" end if block RatatuiRuby.draw(&block) else RatatuiRuby.draw(tree) end end
Draws the given UI node tree to the terminal. @see RatatuiRuby.draw
Source
# File lib/ratatui_ruby/tui/core.rb, line 46 def draw_cell(x, y, cell) Draw.cell(x, y, cell) end
Creates a Draw::CellCmd for placing a cell at coordinates. @return [Draw::CellCmd]
Source
# File lib/ratatui_ruby/tui/core.rb, line 40 def get_cell_at(x, y) RatatuiRuby.get_cell_at(x, y) end
Inspects the terminal buffer at specific coordinates. @see RatatuiRuby.get_cell_at
Source
# File lib/ratatui_ruby/tui/core.rb, line 52 def insert_before(height, widget = nil, &) RatatuiRuby.insert_before(height, widget, &) end
Inserts content above an inline viewport. @see RatatuiRuby.insert_before
Source
# File lib/ratatui_ruby/tui/core.rb, line 34 def poll_event(timeout: 0.016) RatatuiRuby.poll_event(timeout:) end
Checks for user input. @see RatatuiRuby.poll_event
Source
# File lib/ratatui_ruby/tui/core.rb, line 57 def terminal_area RatatuiRuby.terminal_area end
Gets the Rect of the entire terminal, regardless of viewport
Source
# File lib/ratatui_ruby/tui/core.rb, line 62 def viewport_area RatatuiRuby.viewport_area end
Gets the Rect of the viewport