'Browse' button
Posted: March 9th, 2007, 6:57 pm
I have this script that has a really simple UI with a checkbox and a browse box for entering a file location.
It works fine on a mac, but the browse button is seemingly disabled on the pc. The weird thing is that the 'ok' and 'cancel' buttons work fine.
What gives ?
function buildUI() {
if (win != null) {
win.OutputFolder = win.add('statictext', [31,80,181,120], 'Maya frame counter:');
win.mayacheck = win.add('checkbox', [190,80,210,100], '');
win.mayacheck.value = true;
win.OutputFolder = win.add('statictext', [31,130,131,190], 'Import Folder:');
win.filelocation = win.add('edittext', [143,130,403,190], '', {multiline: true});
win.varspnl = win.add('panel', [20,35,530,210], 'Variables');
win.Browse = win.add('button', [416,130,496,150], 'Browse', {name:'Browse'});
win.Browse.onClick = function () {
var defaultFolder = this.parent.filelocation.text;
targetFolder = folderGetDialog("Import Folder");
if (targetFolder != null)
this.parent.filelocation.text = targetFolder.fsName;
}
win.cancel = win.add('button', [21,220,101,240], 'Cancel', {name:'Cancel'});
win.cancel.onClick = function () {this.parent.close(1)};
win.ok = win.add('button', [450,220,530,240], 'OK', {name:'OK'});
win.ok.onClick = function () {
I can post more of the script if needed.
Thanks for any help.
-Stephen.
It works fine on a mac, but the browse button is seemingly disabled on the pc. The weird thing is that the 'ok' and 'cancel' buttons work fine.
What gives ?
function buildUI() {
if (win != null) {
win.OutputFolder = win.add('statictext', [31,80,181,120], 'Maya frame counter:');
win.mayacheck = win.add('checkbox', [190,80,210,100], '');
win.mayacheck.value = true;
win.OutputFolder = win.add('statictext', [31,130,131,190], 'Import Folder:');
win.filelocation = win.add('edittext', [143,130,403,190], '', {multiline: true});
win.varspnl = win.add('panel', [20,35,530,210], 'Variables');
win.Browse = win.add('button', [416,130,496,150], 'Browse', {name:'Browse'});
win.Browse.onClick = function () {
var defaultFolder = this.parent.filelocation.text;
targetFolder = folderGetDialog("Import Folder");
if (targetFolder != null)
this.parent.filelocation.text = targetFolder.fsName;
}
win.cancel = win.add('button', [21,220,101,240], 'Cancel', {name:'Cancel'});
win.cancel.onClick = function () {this.parent.close(1)};
win.ok = win.add('button', [450,220,530,240], 'OK', {name:'OK'});
win.ok.onClick = function () {
I can post more of the script if needed.
Thanks for any help.
-Stephen.