class

Opal::UI::ModalScreen

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

Modal Screen inspired by Python Textual's ModalScreen. Automatically dims/blurs the underlying screen, traps keyboard/mouse focus, and returns a typed dismissal result back to the calling screen.

Constructors

new(name : String = "modal", title : String | Nil = nil, root : Element | Nil = nil, dim_backdrop : Bool = true)
Source
new(name : String = "modal", title : String | Nil = nil, dim_backdrop : Bool = true, &)
Source

Instance methods

dim_backdrop=(dim_backdrop : Bool)
Source
dim_backdrop?
Source
dismiss(result : ModalResult = nil) : Nil

Dismisses the modal screen and passes result to completion callback

Source
dismissed=(dismissed : Bool)
Source
dismissed?
Source
handle_key(event : Terminal::KeyEvent) : Bool

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

Source
on_dismiss
Source
on_dismiss=(on_dismiss : Proc(ModalResult, Nil) | Nil)
Source