class

Opal::UI::Checkbox

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

Interactive checkbox widget supporting keyboard (Space/Enter) toggle, mouse click hit-testing, customizable glyphs, and theming.

Constructors

new(label : String | Nil = nil, checked : Bool = false, disabled : Bool = false, on_change : Proc(Bool, Nil) | Nil = nil)
Source
new(label : String | Nil = nil, checked : Bool = false, disabled : Bool = false, &block : Bool -> Nil) : Checkbox
Source

Instance methods

box_bg
Source
box_bg=(box_bg : Color | Nil)
Source
box_fg
Source
box_fg=(box_fg : Color | Nil)
Source
checked=(val : Bool)
Source
checked?
Source
checked_fg
Source
checked_fg=(checked_fg : Color | Nil)
Source
checked_glyph

Customizable glyphs and styling

Source
checked_glyph=(checked_glyph : String | Nil)

Customizable glyphs and styling

Source
disabled=(disabled : Bool)
Source
disabled?
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
label
Source
label=(label : String | Nil)
Source
label_fg
Source
label_fg=(label_fg : Color | Nil)
Source
on_change
Source
on_change
Source
on_change=(on_change : Proc(Bool, 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
toggle
Source
unchecked_glyph
Source
unchecked_glyph=(unchecked_glyph : String | Nil)
Source