Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 92406

Re: Replace image in UI

$
0
0

So I figured it out, after spending more time on forum.

 

I ended up adding buttons to Group that's orientation is Stack.

And once button is clicked, I just toggle visibility.

 

var win = new Window("palette", "Settings", undefined);

 

 

var imgON = "/Users/renderTom/Desktop/Custom\ Checkbox/checkON.jpg";

var imgOFF = "/Users/renderTom/Desktop/Custom\ Checkbox/checkOFF.jpg";

 

 

var myGrp = win.add("group");

myGrp.orientation = "stack";

 

 

var button = myGrp.add("iconbutton", undefined, ScriptUI.newImage(imgON, undefined, imgOFF, imgON), {style:'toolbutton'});

var buttonOFF = myGrp.add("iconbutton", undefined, ScriptUI.newImage(imgOFF, undefined, imgON, imgOFF), {style:'toolbutton'});

 

 

win.show();

 

 

button.onClick = function() {

  button.visible = false;

  buttonOFF.visible = true;

}

 

 

buttonOFF.onClick = function() {

  buttonOFF.visible = false;

  button.visible = true;

}


Viewing all articles
Browse latest Browse all 92406

Trending Articles



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