Hoi Andreas,
> 1. I've done a script (the one bekow), that after hiting start does
> some long calculations (could last 5 mins). During that a progress bar
> opens. The problem is that I want to be able to abort this calculation
> with a cancel button in the progress bar window . This will obviously
> not work, because the gui will only accept an input during the
> handle_app procedure.
> Is this even possible?
Using only "Return" and not "ReturnID" my be better:
[...]
/* this will work */
call Notify("progress","CloseRequest",1,"app","Return","LEAVEME")
call Notify("cancel","pressed",0,"app","Return","LEAVEME")
return
/* this is the function i want to leave, pressing the button */
lets_go: procedure
call set('win','Sleep',1)
call set("progress","open",1)
DO cds=1 to 10000
h.NoWait = 1
call NewHandle("APP","H")
if h.event="LEAVEME" then leave
/* counter for progress bar */
percent=trunc(cds*100/10000)
call set("gauge_glob_progress","Current",percent)
call set("gauge_glob_progress","InfoText",disk_nr" CDs found:" percent||"%")
call set("gauge_glob_progress","ShowMe",1)
END
call set("progress","open",0)
call set('win','Sleep',0)
return
--
cu, Bernd