arnaldo
06-25-2007, 06:15 AM
Hi everybody,
I have a method which takes some seconds to execute, and I want to let the user know when it is running. So I wrote the following code:
<canvas>
<method name="slowProcess">
<![CDATA[
var c = 1.000001;
for(var i=0;i<1000;i++)
for(var j=0;j<400;j++)
c = Math.pow(c,c);
]]>
</method>
<simplelayout axis="x"/>
<button>Process
<handler name="onclick">
txtProcessing.setVisible(true);
canvas.slowProcess();
txtDone.setVisible(true);
</handler>
</button>
<text id="txtProcessing" visible="false">Processing...</text>
<text id="txtDone" visible="false">Done</text>
</canvas>
However, the "Processing..." text only appears when the process has finished.
How can I make it work?
I have a method which takes some seconds to execute, and I want to let the user know when it is running. So I wrote the following code:
<canvas>
<method name="slowProcess">
<![CDATA[
var c = 1.000001;
for(var i=0;i<1000;i++)
for(var j=0;j<400;j++)
c = Math.pow(c,c);
]]>
</method>
<simplelayout axis="x"/>
<button>Process
<handler name="onclick">
txtProcessing.setVisible(true);
canvas.slowProcess();
txtDone.setVisible(true);
</handler>
</button>
<text id="txtProcessing" visible="false">Processing...</text>
<text id="txtDone" visible="false">Done</text>
</canvas>
However, the "Processing..." text only appears when the process has finished.
How can I make it work?