use process on KernelLog
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package bin;
|
||||
|
||||
import kernel.ps.ProcessHandle;
|
||||
import kernel.ps.Process;
|
||||
import lib.Color;
|
||||
import lib.MathI;
|
||||
import kernel.log.Log;
|
||||
@@ -8,24 +10,22 @@ import lib.ui.UIApp;
|
||||
|
||||
using tink.CoreApi;
|
||||
|
||||
class KernelLog extends UIApp{
|
||||
private var ctx:WindowContext;
|
||||
private var exitTrigger: Bool -> Void;
|
||||
class KernelLog implements Process {
|
||||
private var handle: ProcessHandle;
|
||||
private var ctx: WindowContext;
|
||||
|
||||
public function new() {}
|
||||
|
||||
public function invoke(context:WindowContext):Future<Bool> {
|
||||
this.ctx = context;
|
||||
public function run(handle: ProcessHandle):Void {
|
||||
this.handle = handle;
|
||||
|
||||
var statelessCtx = handle.createStatelessWindowContext();
|
||||
this.ctx = statelessCtx.ctx;
|
||||
|
||||
statelessCtx.setRenderFunc(this.render);
|
||||
|
||||
Log.instance.onLog.handle(()->{
|
||||
render();
|
||||
});
|
||||
|
||||
render();
|
||||
|
||||
return new Future<Bool>(cb -> {
|
||||
this.exitTrigger = cb;
|
||||
return null;
|
||||
statelessCtx.requestRender();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user