View Full Version : Test Field Focus Out


chayanvinayak
10 October 2007, 11:09 PM
hi,

I am making two text fields , i want :

- if one text field is focused out second field should have : field_one_value + "some text"


what code to write for that.

thanks
Chayan

Mikademius
10 October 2007, 07:19 PM
//Check if the window exists. If it does, kill it!
if (`window -ex "ah_textSwitchWin"`)deleteUI ah_textSwitchWin;

//Create window
window -t "textFields jumping :)" -wh 200 74 -s 0 ah_textSwitchWin;
//Simple Column
columnLayout;
//This is the field that will spit some text to the other field
textField -w 150 -rfc ah_switch ah_tF1;
//This is the field that will recieve some text from the other field and then add some more text
textField -w 150 ah_tF2;

showWindow ah_textSwitchWin;

global proc ah_switch(){
string $ah_getText1 = `textField -q -tx ah_tF1`;
textField -e -tx ($ah_getText1 + " some text!") ah_tF2;
}


However you have to write something in the first Field and then click outside to then click inside it again to update the latter one. But with this code I'm sure you manage to implement it in your own code :) cheers

CGTalk Moderation
10 October 2007, 07:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.


1