From 418952bd251e1c5c20ad46fdf22a92ec64fc29d1 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Tue, 22 Feb 2022 01:48:31 +0100 Subject: [PATCH] startup changes --- src/Startup.hx | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/Startup.hx b/src/Startup.hx index 4aab47c..abdcb57 100644 --- a/src/Startup.hx +++ b/src/Startup.hx @@ -1,3 +1,4 @@ +import haxe.MainLoop; import kernel.Init; import lib.ui.Observable; import lib.ui.TextElement; @@ -11,20 +12,11 @@ class Startup { public static function main() { Init.initKernel(); + MainLoop.add(() -> { + KernelEvents.instance.startEventLoop(); + },0); + 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() { @@ -38,7 +30,7 @@ class Startup { ]); ui.render(); - + context.clickSignal.handle(data -> { text.set("Holla mundo"); });