From e4552b8213259f74cdf60b7f09015e0b4d5879e6 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 30 Jul 2023 23:09:48 +0100 Subject: [PATCH] 4matting --- src/Main.hx | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/Main.hx b/src/Main.hx index 7bf84d1..6e1600e 100644 --- a/src/Main.hx +++ b/src/Main.hx @@ -1,39 +1,35 @@ - - @:uiComp("view") // Naming scheme of component classes can be customized with domkit.Macros.registerComponentsPath(); class ViewComp extends h2d.Flow implements h2d.domkit.Object { - - static var SRC = - + static var SRC = for( i in icons ) ; - public function new(align:h2d.Flow.FlowAlign,icons:Array,?parent) { + public function new(align:h2d.Flow.FlowAlign, icons:Array, ?parent) { super(parent); initComponent(); } - } - @:uiComp("button") class ButtonComp extends h2d.Flow implements h2d.domkit.Object { - static var SRC = - public var label(get, set): String; - function get_label() return labelTxt.text; + public var label(get, set):String; + + function get_label() + return labelTxt.text; + function set_label(s) { labelTxt.text = s; return s; } - public function new( ?parent ) { + public function new(?parent) { super(parent); initComponent(); enableInteractive = true; @@ -52,13 +48,11 @@ class ButtonComp extends h2d.Flow implements h2d.domkit.Object { }; } - public dynamic function onClick() { - } + public dynamic function onClick() {} } @:uiComp("container") class ContainerComp extends h2d.Flow implements h2d.domkit.Object { - static var SRC =