module Crysterm::Mixin::Children

Direct including types

Defined in:

mixin/children.cr

Instance Method Summary

Instance Method Detail

def <<(widget : Widget) #

Adds element to list of children. Convenience method identical to #append


[View source]
def >>(widget : Widget) #

Removes element from list of children. Convenience method identical to #remove


[View source]
def append(element) #

Appends element to list of children


[View source]
def append(*elements) #

Appends elements to list of children in the order given (first listed is first added)


[View source]
def children #

Widget's children Widgets.


[View source]
def collect_ancestors(el : Widget) : Array(Widget) #

Returns a flat list of all parent widgets, recursively


[View source]
def collect_descendants(el : Widget) : Array(Widget) #

Returns a flat list of all children widgets, recursively


[View source]
def each_ancestor(&block : Proc(Widget, Nil)) : Nil #

Runs a particular block for all ancestors, recursively


[View source]
def each_descendant(&block : Proc(Widget, Nil)) : Nil #

Runs a particular block for all descendants, recursively


[View source]
def emit_ancestors(ev : EventHandler::Event | EventHandler::Event.class) : Nil #

Emits ev on all parent nodes.


[View source]
def emit_descendants(ev : EventHandler::Event | EventHandler::Event.class) : Nil #

Emits ev on all children nodes, recursively.


[View source]
def has_ancestor?(obj) #

Returns true if obj is found in the list of parents, recursively


[View source]
def has_descendant?(obj) #

Returns true if obj is found in the list of children, recursively


[View source]
def insert(element, i = -1) #

Inserts element into list of children widgets


[View source]
def insert_after(element, other) #

Adds node to the list of children after the specified other element


[View source]
def insert_before(element, other) #

Adds node to the list of children before the specified other element


[View source]
def prepend(element) #

Prepends node to the list of children


[View source]
def remove(element) #

Removes element from list of children widgets


[View source]
def self_and_each_ancestor(&block : Proc(Widget, Nil)) : Nil #

Runs a particular block for self and all ancestors, recursively


[View source]
def self_and_each_descendant(&block : Proc(Widget, Nil)) : Nil #

Runs a particular block for self and all descendants, recursively


[View source]