fix3
This commit is contained in:
@@ -10,18 +10,21 @@ import flash.display.Sprite;
|
|||||||
@:file("examples/form.json")
|
@:file("examples/form.json")
|
||||||
class Form extends JsonAsset {}
|
class Form extends JsonAsset {}
|
||||||
|
|
||||||
class ViewExample {
|
class ViewExample implements ButtonViewListener {
|
||||||
|
|
||||||
public static function main() {
|
public static function main() {
|
||||||
|
new ViewExample();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function new() {
|
||||||
var form:Dynamic = new Form().value;
|
var form:Dynamic = new Form().value;
|
||||||
var listener = {
|
var v:IGroupView<Sprite> = GuiBuilder.build(form, {listener:this});
|
||||||
onPress:function(view:ButtonView):Void {
|
|
||||||
trace("onPress: " + view.id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var v:IGroupView<Sprite> = GuiBuilder.build(form, {listener:listener});
|
|
||||||
new Root(v);
|
new Root(v);
|
||||||
var button3:ButtonView = v.findViewById("panel:button3");
|
var button3:ButtonView = v.findViewById("panel:button3");
|
||||||
trace(button3.id);
|
trace(button3.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function onPress(view:ButtonView):Void {
|
||||||
|
trace("onPress: " + view.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -37,6 +37,6 @@ class ButtonView extends LabelView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef ButtonViewListener = {
|
interface ButtonViewListener {
|
||||||
public function onPress(view:ButtonView):Void;
|
public function onPress(view:ButtonView):Void;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user