my first reaction was - Yes! how could i forget about windows.processPostedMessages()
and have looked in my archive... here is what i found with my own comments:
try (destroydialog progressRol) catch()
rollout progressRol "Progress..." width:200
(
progressbar pb width:186 pos:[8,4]
checkbutton start "Start" width:186 pos:[8,24]
on start changed state do if state do
(
while not keyboard.escpressed and start.state do
(
pb.value += 5
sleep 0.5
windows.processPostedMessages()
)
pb.value = 0
start.state = off
)
)
createdialog progressRol
run this script. by pressing "Start" button you can turn ON/OFF the 'process'. everything works and looks OK while we not press "Close" window button.
if you do it during the running 'process' you will get 'lugging' for all your operations (try to edit code in the editor for example).
so you have to understand that the using of processPostedMessages is not safe in some situations