Hey guys,
I’ve been trying to figure out this one for a little while, and I’m still pretty new to MEL scripting so I’m not even sure I’m going about this the right way. I’m trying to create a text field in a MEL window for a user to enter a file directory. I want to have a “browse” button next to it which they can use to find a file and it’s directory, and then have the string which is returned entered into the text field. Right now my process looks like this:
//browse procedure
proc browseFiles( ) {
$browseFiles = `fileDialog2 -fm 1`;
}
// creates window with controls for user
if (`window -exists ctrlWindow`) deleteUI ctrlWindow;
if (`windowPref -exists ctrlWindow`) windowPref -remove ctrlWindow;
window -title "MatteShader" -widthHeight 275 425 ctrlWindow;
string $browseFiles = "";
rowLayout -numberOfColumns 4 -width 350;
textField -w 200 -tx "" colPath;
button -label "Browse" -w 50 -command "browseFiles()";
setParent ..;
setParent ..;
showWindow ctrlWindow;
So in my mind what I’m trying to do is update the textField box with the $broseFiles string after the button is pressed and the file has been selected…but I can’t figure out a way to update a textField. Is there a better way of going about this whole process?
Thanks for any help!
Jesse