Copy link to clipboard
Copied
When a user clicks on a button, it remains highlighted in blue (to show it was the last button clicked). I'd like to be able to un-highlight it in my onClick callback. Does anyone know how to accomplish that?
Use
this.active = true; this.active = false;
in your onClick function:
#target illustrator
function test(){
var counter = 0;
var w = new Window("dialog");
var btn1 = w.add("button", undefined, "Test 1");
var btn2 = w.add("button", undefined, "Test 2");
var e = w.add("edittext", undefined, "");
e.characters = 10;
btn1.onClick = function(){
e.text = "Click Count: " + (counter++);
this.active = true;
this.active = false;
}
w.show();
};
test();
Copy link to clipboard
Copied
Use
this.active = true; this.active = false;
in your onClick function:
#target illustrator
function test(){
var counter = 0;
var w = new Window("dialog");
var btn1 = w.add("button", undefined, "Test 1");
var btn2 = w.add("button", undefined, "Test 2");
var e = w.add("edittext", undefined, "");
e.characters = 10;
btn1.onClick = function(){
e.text = "Click Count: " + (counter++);
this.active = true;
this.active = false;
}
w.show();
};
test();