Message 1 of 3
Quick problem using textField
Not applicable
02-03-2010
09:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to make a simple GUI that contains a textField and a button. When I press the button, I want to print what is in the textField. I think I'm missing something simple. How do I correctly pass the text from the field to the variable?
Thanks!
Tony
____________________________________________________________________
// Make a window
string $window = `window -title "Name Tool"
-iconName "NmTl"
-widthHeight 200 55`;
columnLayout -adjustableColumn true;
text -label "enter your name";
string $tlName = `textField` ;
button -label "Print Name" -command "tlPrintName $tlName" ;
button -label "Close" -command ("deleteUI -window " + $window)
setParent ..;
showWindow $window;
// Proc that prints the field
global proc tlPrintName ( string $tlName ) {
print $tlName ;
}
I'm trying to make a simple GUI that contains a textField and a button. When I press the button, I want to print what is in the textField. I think I'm missing something simple. How do I correctly pass the text from the field to the variable?
Thanks!
Tony
____________________________________________________________________
// Make a window
string $window = `window -title "Name Tool"
-iconName "NmTl"
-widthHeight 200 55`;
columnLayout -adjustableColumn true;
text -label "enter your name";
string $tlName = `textField` ;
button -label "Print Name" -command "tlPrintName $tlName" ;
button -label "Close" -command ("deleteUI -window " + $window)
setParent ..;
showWindow $window;
// Proc that prints the field
global proc tlPrintName ( string $tlName ) {
print $tlName ;
}