class

TUI::Widget

Inherits Reference < Object

Constructors

new(parent : TUI::Widget | Nil = nil)
Source

Instance methods

<<(win : Widget)
Source
app=(app : Application | Nil)
Source
bind(key : Key | Char, &block : Event::Key -> Bool) : self
Source
bind(mouse : MouseStatus, &block : Event::Mouse -> Bool) : self
Source
border
Source
border=(border : Border | Nil)
Source
dirty
Source
dirty=(v : Bool)
Source
dirty?
Source
dump_tree_rect(io : IO, e : Event::Mouse, far = 0)
Source
focused
Source
focused=(focused : Bool)
Source
h(*args, **options)
Source
h(*args, **options, &)
Source
handle(event : Event::Resize) : Bool
Source
handle(event : Event::Draw) : Bool
Source
handle(event : Event::Key) : Bool

Handle an event:

  • Firstly see if it has been bound
  • Secondly pass to the overwritable key method
  • Then pass to the parent recursively

When there are no parent, false is returned and the event is left unhandled

Source
handle(event : Event::Mouse) : Bool

ditto

Source
height(w : Int32) : Int32 | Nil
Source
height
Source
hover
Source
hover=(hover : Tuple(Int32, Int32) | Nil)
Source
key(event : Event::Key) : Bool

Overwrite to handle other unknown key presses

Source
layout
Source
layout=(layout : Layout | Nil)
Source
mouse(event : Event::Mouse) : Bool

Overwrite to handle other unknown mouse events

Source
paint(surface : Painter) : Bool

Override to draw in the widget

Source
parent
Source
parent!
Source
parent=(new_parent : TUI::Widget | Nil)
Source
rect
Source
rect=(rect : Rect)
Source
rect?
Source
set_focused(val : Bool)
Source
set_hover(e : Event::Mouse)
Source
set_hover(xy : Tuple(Int32, Int32) | Nil)
Source
tree_focused?
Source
unbind(key : Key | Char) : self
Source
unbind(mouse : MouseStatus) : self
Source
unbind_all
Source
unbind_keys
Source
unbind_mouse
Source
w(*args, **options)
Source
w(*args, **options, &)
Source
width(h : Int32) : Int32 | Nil
Source
width
Source
x(*args, **options)
Source
x(*args, **options, &)
Source
y(*args, **options)
Source
y(*args, **options, &)
Source

Nested types