I was learning Mel script, I want to try to click the "+" button in the interface you can create more than one textField, then I enter any number in the first textField, click "one" button, the column in the textField content can be automatically modified and the first textField content.
Thankyou
global proc test_change(){
int $query_intField = intField -q -v "int\_tx"
;
intField -e -v ($query_intField + 1) "int_tx";
print ($query_intField + 1 + "\n");
}
global proc addNewButton() {
string $i = intField -q -v "int\_tx"
;
string $rowLayout = "rowLayout_" + $i;
string $sframe = "sframe_tx_" + $i;
string $eframe = "eframe_tx_" + $i;
setParent function_Layout;
rowColumnLayout -p "function_Layout" -cs 2 10 -cs 3 5 -cs 4 5 -cs 5 5 -cs 7 5 -nc 8 -bgc 0.5 0.5 0.5 $rowLayout;
checkBox -v on -l "" ("check_switch"+$i);
textField -p $rowLayout -w 60 $sframe;
textField -p $rowLayout -w 60 $eframe;
separator -st "out" -h 5 -p "function_Layout";
}
//Main
if(window -q -ex "testWin"
)deleteUI("testWin");
window -rtf on
-s on
-mb true
-title "testWin" "testWin";
columnLayout -adj true "columnLayout3";
rowColumnLayout -ann "testLayout" -nc 7 -cs 2 10 -cs 3 5 -cs 4 5 -cs 5 20 -cs 6 40 -p "columnLayout3" "control_Layout" ;
iconTextButton -w 22 -h 12 -style "iconOnly" -i "setEdAddCmd.png" -c("test_change();" + "addNewButton();") "add_btn";
button -l "one" "sFrame_btn";
button -l "two" "eFrame_btn";
intField -w 1 -v 0 -vis off "int_tx";
scrollLayout -h 300 -bgc 0.2 0.2 0.2 -p "columnLayout3";
columnLayout -adj true "function_Layout";
showWindow "testWin";