Copy link to clipboard
Copied
opened dialogue window close after 10 seconds
Is there a command to do this
function show_ready( msg, msec) { var w = new Window("palette"); w.add("statictext", undefined, msg); var now = new Date().getTime(); var then = new Date().getTime(); w.show(); while(now-then < msec) { now = new Date().getTime(); } w.close(); }
Does that help?
Copy link to clipboard
Copied
function show_ready( msg, msec) { var w = new Window("palette"); w.add("statictext", undefined, msg); var now = new Date().getTime(); var then = new Date().getTime(); w.show(); while(now-then < msec) { now = new Date().getTime(); } w.close(); }
Does that help?
Copy link to clipboard
Copied
Why does not run (I use the dialog window, dont palette)
var w = new Window("dialog");
Copy link to clipboard
Copied
Yes, that is why it doesn’t work.
A dialog can interact with user events (click of a button) but there are no timer events.
Copy link to clipboard
Copied
Anyway if you really need a modal solution (i.e. dialog) you can trigger the timer within the activate event handler:
function show_ready_dial(/*str*/msg,/*uint*/msec, w,u)
{
(w=new Window('dialog')).add('statictext',u,msg);
w.onActivate = function(){ $.sleep(msec); this.close(); };
w.show();
}
// Test
// ---
show_ready_dial("This should work.",10000);
@+
Marc