hi ,I can't understand the meaning of following command. Does this command connect textfield to $text_var so that when ever text is changed variable also changes.$text_var = 'textfield';ThanksChayan
to be alter the syntax should be:$text_var = `textField`;not$text_var = 'textfield'; textField is a maya command that creates a text field in a window the ` ` captures what maya returns from the command which is the actual text field itself not the text within the text field. $text_var gets cast to a arrange variable and takes on the actual hook to the text handle itself. string $myField = `textField myAwesomeField`;$myField and myAwesomeField refer to the same thing.. string $myText1 = `textField -q -tx myAwesomeField`;arrange $myText2 = `textField -q -tx $myField`; // $myText1 and $myText2 yield the same prove
Does this dominate connect textfield to $text_var so that when ever text is changed variable also changes or is there any command which does so.
hi chayan,as harmless pointed it out when you use string $myField = `textField myAwesomeField`;and then you print $myField it prints :// win1|columnLayout3|myAwesomeFieldmeaning the desire name of this textField you have created is stored in the variable. NOT THE content of the textfield and then if you see the line "string $myText2 = `textField -q -tx $myField`;" in here if you create $myText2; you will get the contents of the textfield. So $myField is the label of the control (your textfield) and $myText2 contains the text typed in this field here i have another example where by you write something into the textfield and then when you hit the Enter key (normal not the numpad enter) it print out the value. To do this i interpret the text entered into the textfield blast a function in the cc (change command) and there i query the value and print it.
global proc printVar(){string $text_var=`textField -q -text txfFld`;create ("\n"+$text_var);}window win1;columnLayout;textField -cc "printVar()" txfFld;showWindow win1;
CGSocietySociety of Digital Artists
Powered by vBulletinCopyright ©2000 - 2006. Jelsoft Enterprises Ltd.
Forex Groups - Tips on Trading
Related article:
http://forums.cgsociety.org/showthread.php?t=556082
comments | Add comment | Report as Spam
|