|
- import win.ui;
- /*DSG{{*/
- mainForm = win.form(text="aardio form";right=759;bottom=469)
- mainForm.add(
- edit={cls="edit";left=14;top=246;right=743;bottom=455;db=1;dl=1;dr=1;dt=1;edge=1;multiline=1;z=1}
- )
- /*}}*/
- import console;
- console.open();
- import thread.command;
- var listener = thread.command();
- listener.print = function( ... ){
- //mainForm.edit.print( ... ) //将线程传过来的参数追加输出到文本框
- console.log(...);
- }
- //创建工作线程,线程内错误信息默认输出到控制台
- thread.invoke(
- function(hwnd){
-
- //必须在线程函数内部导入需要的库
- import thread.command;
- while(true){
- //调用界面线程的命令
- thread.command.print("hello world",1,2,3);
-
- //也可以用post方法异步调用线程命令,不会等待调用完成
- thread.command.post("print","hello world",1,2,3);
- }
- }
- );
- mainForm.enableDpiScaling();
- mainForm.show();
- return win.loopMessage();
复制代码
一般采样程序都会有循环采样,我在工作线程中加一个循环作试验,图形界面就很卡了,有没有什么办法让界面不卡? |
|