class

Control

Inherits Reference < Object

Class methods

name_to_action
Source

Instance methods

add(control, x = 0, y = 0)

Makes control a child of this one.

Source
bind_keys

For each bindable function, aka action, if that action exists in the keymap, associate the keymap's key with that action for this specific control.

Source
children
Source
dirty
Source
dirty=(dirty : Bool)
Source
focus

called when this control becomes the active control. It will start receiving keystrokes after this point.

Source
focusable?

if this control can take keyboard input Only frames, screens, and non-interactive elements should return false.

Source
height
Source
height=(height : Int32 | Nil)
Source
height?
Source
key(k)

by default, key assumes any key press will cause the control to change state. If you e.g. are at the top of a list, and attempt a prev_item action, the code for prev_action must explicitly set @dirty to false to prevent extraneous repaints. This is purposefully done for developer productivity.

Source
letter(k)

processes space and any printable character.

Source
main_window
Source
main_window=(main_window : Nil | MainWindow)
Source
main_window?
Source
other(k)

handles keystrokes that aren't explicitly bound.

Source
paint(term)
Source
parent
Source
parent=(parent : Control | Nil)
Source
parent?
Source
text

should return the text to be painted to the screen

Source
user_x
Source
user_y
Source
verify(child)

pass a child control to this method for verification

Source
width
Source
width=(width : Int32 | Nil)
Source
width?
Source
wip_verify_no_overlap

will verify that none of the four corners of new child overlap with an existing child, and that no existing child overlaps any of it's 4 corners with new child.

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

Macros

action(func)

writing action def name... creates an action that can be bound to a key we have this macro include itself again below so that the action gets copy-and-pasted to each subclass. because class vars aren't singletons, subclassing a control removes all action bindings from the subclassed control by default. This undo's that removal.

Source
action(key, func)
Source