abstract class TextUi::Widget

Direct Known Subclasses

Defined in:

textui/widget.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(parent : Widget, x : Int32 = 0, y : Int32 = 0, width : Int32 = 1, height : Int32 = 1) #

[View source]

Class Method Detail

def self.text_dimensions(text : String, max_width = -1, max_height = -1) #

[View source]

Instance Method Detail

def absolute_height #

[View source]
def absolute_width #

[View source]
def absolute_x #

[View source]
def absolute_y #

[View source]
def children : Array(TextUi::Widget) #

[View source]
def children?(widget : Widget) : Bool #

[View source]
def children_focused? #

[View source]
def clear_line(y : Int32, format = @default_format) #

[View source]
def contains?(x, y) #

x/y are in absolute coordinates


[View source]
def default_format : Format #

[View source]
def default_format=(default_format : Format) #

[View source]
def destroy #

[View source]
def each_char_pos(x, y, text : String, &) #

[View source]
def find(x, y, dbg = 0) : Widget | Nil #

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


[View source]
def focus #

[View source]
def focusable=(focusable : Bool) #

[View source]
def focusable? : Bool #

[View source]
def focused=(focused : Bool) #

[View source]
def focused? : Bool #

[View source]
def height : Int32 #

[View source]
def height=(height : Int32) #

[View source]
def invalidate #

[View source]
def move(x : Int32, y : Int32) #

[View source]
def parent : TextUi::Widget #

[View source]
def print_char(x : Int32, y : Int32, chr : Char, format : Format = @default_format) #

[View source]
def print_line(x : Int32, y : Int32, text : String, format : Array(Format) | Format = @default_format, offset = 0, count = text.size, width = 0, ellipsis = true) : Nil #

[View source]
def print_lines(x, y, text : String, format : Format = @default_format, width = 0) #

[View source]
abstract def render #

[View source]
def render_cursor #

[View source]
def render_pending=(render_pending : Bool) #

[View source]
def render_pending? : Bool #

[View source]
def resize(width : Int32, height : Int32) #

[View source]
def set_cursor(x, y) #

[View source]
def ui #

[View source]
def visible=(visible : Bool) #

[View source]
def visible? : Bool #

[View source]
def 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.


[View source]
def width : Int32 #

[View source]
def width=(width : Int32) #

[View source]
def x : Int32 #

[View source]
def x=(x : Int32) #

[View source]
def y : Int32 #

[View source]
def y=(y : Int32) #

[View source]