class MainWindow

Defined in:

controls/main_window.cr

Constructors

Instance Method Summary

Instance methods inherited from class Control

add(control, x = 0, y = 0) add, bind_keys bind_keys, children : Array(Control) children, dirty : Bool dirty, dirty=(dirty : Bool) dirty=, focus focus, focusable? focusable?, height height, height=(height : Int32 | Nil) height=, height? : Int32? height?, key(k) key, letter(k) letter, main_window main_window, main_window=(main_window : Nil | MainWindow) main_window=, main_window? : MainWindow? main_window?, other(k) other, paint(term) paint, parent parent, parent=(parent : Control | Nil) parent=, parent? : Control? parent?, text text, user_x : Int32 user_x, user_y : Int32 user_y, verify(child) verify, width width, width=(width : Int32 | Nil) width=, width? : Int32? width?, wip_verify_no_overlap wip_verify_no_overlap, x x, x=(x : Int32) x=, x? : Int32 x?, y y, y=(y : Int32) y=, y? : Int32 y?

Class methods inherited from class Control

name_to_action name_to_action

Macros inherited from class Control

action(func)
action(key, func)
action

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def active_control #

[View source]
def active_control=(control : Control) #

[View source]
def active_control? : Control? #

[View source]
def add_keys(keys) #

[View source]
def all_children #

[View source]
def do_refresh #

repaints the screen.


[View source]
def focus #
Description copied from class Control

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


[View source]
def focusable? #

MainWindow is not directly interactive, though being the top-level parent, it does see keystrokes.


[View source]
def handle_key(k) #

modeled after bubbling events in web browsers. Send the key to the currently active control, and continue sending it up the control's parents, so long as each control returns :continue. If any control sets it's dirty flag, trigger a refresh.


[View source]
def handle_refresh #

[View source]
def keys : Hash(String, Array(String)) #

[View source]
def load_keys #

[View source]
def next_control #

[View source]
def paint(term) #

Sets focus to the nearest child/sibling control.


[View source]
def quit #

exit the program. Not named exit because that is a crystal kernel method.


[View source]
def react_to_keys #

[View source]
def read_keys #

Keys are processed in their own fiber.


[View source]
def refresh #

[View source]
def run #

[View source]
def sort_keys #

[View source]
def terminate #

[View source]
def text #

MainWindow holds other controls so has no text of it's own.


[View source]