Class: TuiTui::Modal

Inherits:
Object
  • Object
show all
Defined in:
lib/tui_tui/modal.rb

Overview

Base protocol and shared centered-panel framing for overlay widgets.

Direct Known Subclasses

Confirm, Help, Pager, Prompt, Select

Constant Summary collapse

PAD =
2

Instance Method Summary collapse

Instance Method Details

#draw(_canvas, _size) ⇒ Object

Raises:

  • (NotImplementedError)


18
# File 'lib/tui_tui/modal.rb', line 18

def draw(_canvas, _size) = raise NotImplementedError, "#{self.class}#draw"

#handle(_key) ⇒ Object

Raises:

  • (NotImplementedError)


11
# File 'lib/tui_tui/modal.rb', line 11

def handle(_key) = raise NotImplementedError, "#{self.class}#handle"

#handle_mouse(_event) ⇒ Object

Optional mouse handling, same return contract as #handle (resolved value, or nil to stay open). Default no-op so widgets opt in only as needed; the host routes MouseEvents here and KeyEvents to #handle.



16
# File 'lib/tui_tui/modal.rb', line 16

def handle_mouse(_event) = nil