From: Alexis Laferrière Date: Wed, 6 Apr 2016 02:04:06 +0000 (-0400) Subject: lib/app: ToogleEvent X-Git-Url: http://nitlanguage.org lib/app: ToogleEvent Signed-off-by: Alexis Laferrière --- diff --git a/lib/app/ui.nit b/lib/app/ui.nit index 4efbb87..7c9b2f9 100644 --- a/lib/app/ui.nit +++ b/lib/app/ui.nit @@ -211,12 +211,29 @@ class CheckBox var is_checked = false is writable end +# Event sent from a `VIEW` +class ViewEvent + super AppEvent + + # The `VIEW` that raised this event + var sender: VIEW + + # Type of the `sender` + type VIEW: View +end + # A `Button` press event class ButtonPressEvent - super AppEvent + super ViewEvent + + redef type VIEW: Button +end + +# The `CheckBox` `sender` has been toggled +class ToggleEvent + super ViewEvent - # The `Button` that raised this event - var sender: Button + redef type VIEW: CheckBox end # A layout to visually organize `Control`s