Copy link to clipboard
Copied
Hi All,
I have created three buttons on my dialog (OK, Cancel and Remove). OK and Cancel working fine.
How can I destroy my dialog on click of Remove button?
Thanks,
Shonky
Hey!
This is same as Marc example:
win = new Window('dialog', 'test');
win.test_btn = win.add('button', undefined, 'New Document');
win.test_btn.onClick = function() {win.close(0);}
win.test_btn1 = win.add('button', undefined, 'Open Document');
win.test_btn1.onClick = function() {win.close(1);}
win.center();
var myDlg = win.show();
if(myDlg == 0){
alert("New document");
}else if(myDlg == 1){
alert("Open document");
}
Hope that helps.
--
tomaxxi
http://indisnip.wordpress.com/
Copy link to clipboard
Copied
Hey!
U are using ScriptUI?
--
tomaxxi
http://indisnip.wordpress.com/
Copy link to clipboard
Copied
Yes tomaxxi, I am using ScriptUI.
Shonky
Copy link to clipboard
Copied
How can I destroy my dialog on click of Remove button?
Thanks,
Shonky
myWindow.close(/*optional_ret_value*/);
should do the job.
So from an onClick callback:
myRemoveButton.onClick = function() {this.window.close();};
@+
Marc
Copy link to clipboard
Copied
Hi Marc,
Thanks, it's working but one more problem coming after this.
My script exit after clicking on this button.
On click of remove button I want close UI (dialog) and want remove some stuff from my document but its not working.
Any suggestion?
Thanks,
Baljeet
Copy link to clipboard
Copied
Hey!
This is same as Marc example:
win = new Window('dialog', 'test');
win.test_btn = win.add('button', undefined, 'New Document');
win.test_btn.onClick = function() {win.close(0);}
win.test_btn1 = win.add('button', undefined, 'Open Document');
win.test_btn1.onClick = function() {win.close(1);}
win.center();
var myDlg = win.show();
if(myDlg == 0){
alert("New document");
}else if(myDlg == 1){
alert("Open document");
}
Hope that helps.
--
tomaxxi
http://indisnip.wordpress.com/
Copy link to clipboard
Copied
Thanks tomaxxi and Marc, Problem solved now.
Shonky
Copy link to clipboard
Copied
Cool!
Glad it works!
Cheers!
--
tomaxxi
http://indisnip.wordpress.com/
Find more inspiration, events, and resources on the new Adobe Community
Explore Now