class

Opal::UI::RichLog

Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object

Streaming, high-performance rolling log viewer inspired by Python Textual's RichLog. Features automatic line-capping ring buffer, auto-scroll to bottom, user scroll lock, ANSI escape sequence preservation, search/filtering, and scrollbar.

Constructors

new(max_lines : Int32 = 1000, auto_scroll : Bool = true, highlight_ansi : Bool = true)
Source

Instance methods

auto_scroll=(auto_scroll : Bool)
Source
auto_scroll?
Source
bg

Manipulable styling

Source
bg=(bg : Color | Nil)

Manipulable styling

Source
border_fg
Source
border_fg=(border_fg : Color | Nil)
Source
clear

Clears all logged lines

Source
filter_query
Source
filter_query=(filter_query : String | Nil)
Source
handle_key(event : Terminal::KeyEvent) : Bool

Default key event handler. Override in subclasses if not using @default_input_proc.

Source
handle_mouse(event : Terminal::MouseEvent) : Bool

Default mouse event handler. Override in subclasses if not using @default_input_proc.

Source
highlight_ansi=(highlight_ansi : Bool)
Source
highlight_ansi?
Source
lines

Stored lines: array of raw strings

Source
log(text : String) : self

Alias for write

Source
max_lines
Source
max_lines=(max_lines : Int32)
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
scroll_offset

Scroll offset (number of lines scrolled from top)

Source
scroll_offset=(scroll_offset : Int32)

Scroll offset (number of lines scrolled from top)

Source
scroll_to_end

Scrolls to the very bottom

Source
scroll_to_top

Scrolls to the very top

Source
scrollbar_thumb_fg
Source
scrollbar_thumb_fg=(scrollbar_thumb_fg : Color | Nil)
Source
text_fg
Source
text_fg=(text_fg : Color | Nil)
Source
write(text : String) : self

Appends a single line or multi-line string to the log buffer

Source