Hi there,
What is the difference between a variable UI layout and add() method UI layout?
Variable UI layout is something like this:
var windowResource = "palette { \ orientation: 'column', \ alignChildren: ['fill', 'top'], \ preferredSize:[300, 130], \ text: 'ScriptUI Window - palette', \ margins:15, \ \ bottomGroup: Group{ \ cd: Checkbox { text:'Checkbox value', value: true }, \ cancelButton: Button { text: 'Cancel', properties:{name:'cancel'}, size: [120,24], alignment:['right', 'center'] }, \ applyButton: Button { text: 'Apply', properties:{name:'ok'}, size: [120,24], alignment:['right', 'center'] }, \ }\ }"; var win = new Window(windowResource); win.show();
add() method UI layout is something like this:
var w = new Window('dialog', 'Random Number Generator'); var btn_group = w.add('group'), btn_ok = btn_group.add('button', undefined, 'Ok'); w.show();
Thanks!