Hi, thanks for stopping by.
Working with scriptUI panel and trying to update icon for my button, but something goes wrong with my code, I guess...
Can someone write what is the problem here?
var mainPanel; function stabpanel(thisObj) { mainPanel =(thisObj instanceof Panel) ? thisObj : new Window("palette", "Change icon", undefined,{resizeable: true}); var iconFolder = "~/path_1/"; mainPanel.manSave = mainPanel.add("iconbutton", [0,0,46,46], File (iconFolder+"AEP.png"), {style: "toolbutton"}); mainPanel.changeButton = mainPanel.add("button", undefined, "Change icon"); mainPanel.layout.layout(true); mainPanel.layout.resize(); mainPanel.onResizing = mainPanel.onResize = function (){this.layout.resize ();} mainPanel.changeButton.onClick = function(){ var iconFolder = "~/path_2/"; // code below doesn`t work mainPanel.layout.layout(true); return mainPanel; } return mainPanel; mainPanel.center(); } stabpanel(this);