Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Window of type "palette" and onClose event.

$
0
0

Hi friends

 

I´m having a trouble with an onClose event in a panel of type "palette". Let´s try to explain the problem.

 

Suppose I have this single construction:

 

var myDialog = new Window ("palette", "My dialog", undefined, {closeButton:false});

var bt = myDialog.add ("button", undefined, "Ok", {name:"ok"});

 

myDialog.onClose = function(){

//for example: app.activeDocument.layers.add();

};

 

myDialog.show();

 

 

If I change the window to type "dialog", everything looks preety good, but if I keep the dialog as "palette", then the button "Ok" does not close the dialog and, sure, the onClose does not work.

 

P.S: I need the onClose event because I want that closing code executed even if the user hit "ESC" instead of using "OK" button.

 

Any idea how to manage or an alternative to make the button and the onClose works??

 

Thank you very much

Best Regards

Gustavo.


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>