Closed R3D9477 closed 7 years ago
Try UIBuilder.create(CheckBox)
instead of invoking constructor directly
changed to
package;
import openfl.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
var cb = ru.stablex.ui.UIBuilder.create(ru.stablex.ui.widgets.Checkbox);
cb.states.get("up").text = "UP";
cb.states.get("down").text = "DOWN";
this.addChild(cb);
}
}
but without effect I see the blank screen
Did you invoke UIBuilder.init()
somewhere?
Ah, sorry, I've missed it. I changed source to:
package;
import openfl.display.Sprite;
class Main extends Sprite {
public function new () {
super ();
ru.stablex.ui.UIBuilder.init();
var cb = ru.stablex.ui.UIBuilder.create(ru.stablex.ui.widgets.Checkbox);
cb.states.get("up").text = "UP";
cb.states.get("down").text = "DOWN";
this.addChild(cb);
}
}
but it also have not effect
just needed to call method updateState() manually. is it possible to call this method automatically after status changed?
That should be called automatically when creating UI via xml. I will try to make it work without xml later this week.
Thanks!
Hi. I trying to change state properties of dynamically generated checbox:
but I see a blank screen.
Linux Mint 18 x16 latest StablexUI from git openfl 4.4.1 lime 3.4.1 haxe 3.2.1 neko 2.1.0
targets: neko and cpp
Any ideas? Thanks.