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(); exampleUI(); KernelEvents.instance.startEventLoop(); } static function exampleProgramm() { var context = WindowManager.instance.createNewContext(); context.clickSignal.handle(data -> { context.setCursorPos(data.pos.x,data.pos.y); context.write("x"); }); context.write("Example programm"); } 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"); } }