class

TextUi::Widget

Inherits Reference / Object

Constructors

new(parent : Widget, x : Int32 = 0, y : Int32 = 0, width : Int32 = 1, height : Int32 = 1)
Source

Class methods

text_dimensions(text : String, max_width = -1, max_height = -1)
Source

Instance methods

absolute_height
Source
absolute_width
Source
absolute_x
Source
absolute_y
Source
children
Source
children?(widget : Widget) : Bool
Source
children_focused?
Source
clear_line(y : Int32, format = @default_format)
Source
contains?(x, y)

x/y are in absolute coordinates

Source
default_format
Source
default_format=(default_format : Format)
Source
destroy
Source
each_char_pos(x, y, text : String, &)
Source
find(x, y, dbg = 0) : Widget | Nil

Finds the topmost widget at x/y coordinates, x/y are in absolute coordinates.

Source
focus
Source
focusable=(focusable : Bool)
Source
focusable?
Source
focused=(focused : Bool)
Source
focused?
Source
height
Source
height=(height : Int32)
Source
invalidate
Source
move(x : Int32, y : Int32)
Source
parent
Source
render
Source
render_cursor
Source
render_pending=(render_pending : Bool)
Source
render_pending?
Source
resize(width : Int32, height : Int32)
Source
set_cursor(x, y)
Source
visible=(visible : Bool)
Source
visible?
Source
widget_too_small?

Return true if the widget is too small to be rendered. If a widget is too small it wont be rendered or receive any input events.

Source
width
Source
width=(width : Int32)
Source
x=(x : Int32)
Source
y=(y : Int32)
Source