On Mon, 21 May 2012, sundar j wrote:
> 
> TextLabel.Text = "Copy in progress"
> 
> Shell "cp -r <src> <dst>" Wait
> TextLabel.Text = "Completed."
> 
> I used above code in my application. Shell indicated that all files are being 
> copied one-by-one. But TextLable did not display Copy in progress. I did lot 
> of experiment with the above code. Finaly i got it working by adding time 
> delay just before shell command. Now my code looks like this :-
> 
> TextLabel.Text = "Copy in progress"
> wait 0.1
> 
> Shell "cp -r <src> <dst>" Wait
> 
> TextLabel.Text = "Completed."
> 
> I really have no clue  why code worked after inserting time delay. 
> 

For public again:

Actually, it does not depend on the *delay*. If you use the WAIT instruction, 
the interpreter
re-enters its event loop. Only in this loop, changes to the GUI are made 
effective. So just call

Wait

without any parameter so that the interpreter spends only as long there as it 
needs to process all
the pending events and refresh the GUI.
You can read that on: http://www.gambasdoc.org/help/cat/eventloop?v3

Regards,
Tobi

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to