ScriptUI window.minimized = true; on Mac
I would like to make custom palettes for Illustrator which have the ability to get out of the way, similar to native palettes. On Windows, my minimized = true; command works, and the palette shrinks into a tiny bar, which I like. However, same command on Mac does not do the trick.
#target illustrator
#targetengine main
function myPanel(){
var arr = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
function paletteWindow(){
var w = new Window('palette', 'My Panel', undefined, {resizeable: true});
var g1 = w.add('group');
var t = g1.add('treeview', undefined, []); t.size = [200, 450];
for(var i=0; i<arr.length; i++){
var item = arr;
var n = t.add('node', item);
}
t.onDoubleClick = function(){
if(t.selection != null && t.selection.text != ''){
alert(t.selection.text);
}
};
var btn_min = w.add('button', undefined, 'Minimize');
btn_min.onClick = function(){
w.minimized = true;
w.update();
}
w.onResizing = w.onResize = function () {this.layout.resize ();}
w.onShow = function(){
w.minimumSize.width = 220;
w.minimumSize.height = 100;
t.items[1].expanded = true;
}
this.show = function(){w.show();}
}
var thisPaletteWindow = new paletteWindow(); // have to call it like this, or it disappears.
thisPaletteWindow.show();
}
myPanel();
