GUI::Component
Inherits GUI::Eventable < Reference < Object
Constructors
Instance methods
Override this to compose complex components.
You'll have access to the root display Component so that
you can use the display dimensions in constraints if needed.
When composing your custom component you must add the sub-components to
@children otherwise they won't be picked up by the constraint solver.
Example
def build(display : Component)
child = MySubComponent.new
# set some constraints...
@children << child
end
Enumerate over all Components in this Component's hierarchy.
This first yields the component itself, then it's children.
Sets the callback to execute when the hover event is received.
The block provided here will be executed within #on_hover.
Sets the callback to execute when the input event is received.
The block provided here will be executed within #on_input.
Sets the callback to execute when the key_down event is received.
The block provided here will be executed within #on_key_down.
Sets the callback to execute when the key_up event is received.
The block provided here will be executed within #on_key_up.
Sets the callback to execute when the mouse_down event is received.
The block provided here will be executed within #on_mouse_down.
Sets the callback to execute when the mouse_in event is received.
The block provided here will be executed within #on_mouse_in.
Sets the callback to execute when the mouse_out event is received.
The block provided here will be executed within #on_mouse_out.
Sets the callback to execute when the mouse_up event is received.
The block provided here will be executed within #on_mouse_up.
Generates the matrix transformation used for drawing the component within the viewpoint.