bright-gpu-74537
01/14/2021, 4:30 PMuser
01/15/2021, 6:44 PMsys APIs - is there any backend that gives me particular advantages or disadvantages for that?powerful-morning-89
01/15/2021, 7:16 PMuser
01/15/2021, 7:18 PMuser
01/15/2021, 7:19 PMambitious-knife-25690
01/15/2021, 7:22 PMpowerful-morning-89
01/15/2021, 7:24 PMambitious-knife-25690
01/15/2021, 7:24 PMpowerful-morning-89
01/15/2021, 7:24 PMambitious-knife-25690
01/15/2021, 7:24 PMpowerful-morning-89
01/15/2021, 7:25 PMbright-gpu-74537
01/16/2021, 9:08 AMuser
01/16/2021, 3:54 PMbtn is just a regular Button and lbl a Label )
haxe
btn.onClick = (e) -> {
btn.color = "red";
btn.allowInteraction = false;
lbl.text = "Running";
sys.thread.Thread.create(() -> {
Sys.sleep(1);
lbl.text = "Idle";
btn.color = "gray";
btn.allowInteraction = true;
});
}powerful-morning-89
01/16/2021, 4:25 PMhaxe.Timer.delay or a backend-specific equivalent)user
01/16/2021, 4:29 PMSys.sleep is just to simulate the thread running for some time
My current use-case would be to scan through a few thousand files, do some modifications and then report back to the user which files were affected. Doing this on the UI thread would obviously be bad, so I need to move the operation into its own thread.powerful-morning-89
01/16/2021, 4:34 PMuser
01/16/2021, 4:43 PMpowerful-morning-89
01/16/2021, 7:12 PMhaxe.ui.util.Timerbulky-exabyte-6537
01/16/2021, 7:12 PMhaxe.MainLoop.add()bulky-exabyte-6537
01/16/2021, 7:12 PMpowerful-morning-89
01/16/2021, 7:17 PMuser
01/16/2021, 7:18 PMpowerful-morning-89
01/16/2021, 7:19 PMbulky-exabyte-6537
01/16/2021, 7:20 PMhaxe.ui.CallLater is supposed to dopowerful-morning-89
01/16/2021, 7:20 PMbulky-exabyte-6537
01/16/2021, 7:21 PMpowerful-morning-89
01/16/2021, 7:22 PMuser
01/16/2021, 7:24 PMuser
01/16/2021, 7:25 PMbulky-exabyte-6537
01/16/2021, 7:27 PMCallLater does on haxeui-openfl