Progressbar in script UI problem
Hi friends
I´m trying to add a window with a simple progress bar. But I´m having 2 problems. To better explain I made a simple example that reproduces the intent:
#target Bridge
var d1 = new Window ("dialog", "Show images", [0,0,0,0])
d1.size = [600,290]
d1.center()
var exec = d1.add ("button", [0,0,0,0], "Run", {name:"ok"})
exec.size = [80,30]
exec.location = [410,240]
exec.onClick = function (){
d1.close() //first problem is here
var d2 = new Window ("dialog", "Progress", [0,0,0,0])
d2.size = [230,80]
d2.center()
var bProgress = d2.add ("progressbar", [0,0,0,0], 0)
bProgress.size = [200,20]
bProgress.location = [15,20]
var comment = d2.add ("statictext", [0,0,0,0], "Running numbers")
comment.size = [200,20]
comment.location = [15,45]
d2.show()
for (var g=0; g<10; g++){
bProgress.value = bProgress.value + 10
alert(g)
}
}
d1.show()
The 2 problems I´m having are:
1: When pressing the OK in the first dialog..to run the action...I passed a command to close the dlg1. And it does not close (you will se the 2 dialogs keep opened at the same time)
2: Progress bar does not work. It´s expecting myself to close the dlg2 in order to start running the "for" cycle.
--
What Am I missing??
Thank you a lot for the help
Best Regards
Gustavo
Message was edited by: Gustavo Del Vechio
