idk routing stuff i guess

This commit is contained in:
2022-02-24 19:47:27 +01:00
parent ebd9709c3d
commit c96d06653a
25 changed files with 338 additions and 399 deletions

View File

@@ -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");
}
}