class

Opal::UI::Modal

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

A centered floating modal dialog component with backdrop dimming and button choices.

Constructors

new(title : String, message : String, buttons : Array(String) = ["OK"], selected_button : Int32 = 0, border_fg : Color | Symbol | String | Nil = nil, title_fg : Color | Symbol | String | Nil = nil, button_fg : Color | Symbol | String | Nil = nil, selected_fg : Color | Symbol | String | Nil = nil, selected_bg : Color | Symbol | String | Nil = nil, bg : Color | Symbol | String | Nil = nil, border_style : Border | Symbol | String | Nil = nil, dim_backdrop : Bool = true, on_submit : Proc(Int32, Nil) | Nil = nil)
Source
new(title : String, message : String, buttons : Array(String) = ["OK"], selected_button : Int32 = 0, border_fg : Color | Symbol | String | Nil = nil, title_fg : Color | Symbol | String | Nil = nil, button_fg : Color | Symbol | String | Nil = nil, selected_fg : Color | Symbol | String | Nil = nil, selected_bg : Color | Symbol | String | Nil = nil, bg : Color | Symbol | String | Nil = nil, border_style : Border | Symbol | String | Nil = nil, dim_backdrop : Bool = true, &block : Int32 -> Nil) : Modal
Source

Instance methods

bg=(bg : Color | Nil)
Source
border_fg
Source
border_fg=(border_fg : Color | Nil)
Source
border_style
Source
border_style=(border_style : Border | Nil)
Source
button_fg
Source
button_fg=(button_fg : Color | Nil)
Source
buttons
Source
buttons=(buttons : Array(String))
Source
dim_backdrop
Source
dim_backdrop=(dim_backdrop : Bool)
Source
dismiss
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
handle_mouse(event : Terminal::MouseEvent) : Bool

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

Source
message
Source
message=(message : String)
Source
on_submit
Source
on_submit
Source
on_submit=(on_submit : Proc(Int32, Nil) | Nil)
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
selected_bg
Source
selected_bg=(selected_bg : Color | Nil)
Source
selected_button
Source
selected_button=(selected_button : Int32)
Source
selected_fg
Source
selected_fg=(selected_fg : Color | Nil)
Source
submit_selected
Source
title
Source
title=(title : String)
Source
title_fg
Source
title_fg=(title_fg : Color | Nil)
Source