idk routing stuff i guess
This commit is contained in:
@@ -1,41 +1,11 @@
|
||||
import haxe.MainLoop;
|
||||
import kernel.Log;
|
||||
import kernel.Init;
|
||||
import lib.ui.Observable;
|
||||
import lib.ui.TextElement;
|
||||
import lib.ui.ReactiveUI;
|
||||
import kernel.ui.WindowManager;
|
||||
import kernel.KernelEvents;
|
||||
|
||||
using util.Extender.LambdaExtender;
|
||||
|
||||
class Startup {
|
||||
public static function main() {
|
||||
Init.initKernel();
|
||||
|
||||
MainLoop.add(() -> {
|
||||
KernelEvents.instance.startEventLoop();
|
||||
},0);
|
||||
|
||||
exampleUI();
|
||||
}
|
||||
|
||||
static function exampleUI() {
|
||||
var context = WindowManager.instance.createNewContext();
|
||||
|
||||
var text = new Observable("Hello world");
|
||||
|
||||
var ui = new ReactiveUI(context,[
|
||||
new TextElement(text),
|
||||
new TextElement(text,Green,Red),
|
||||
]);
|
||||
|
||||
ui.render();
|
||||
|
||||
context.clickSignal.handle(data -> {
|
||||
text.set("Holla mundo");
|
||||
});
|
||||
|
||||
WindowManager.instance.focusContextToOutput(context,"main");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user