|
First of all, when working with UI this is very important to give a name to all the parts of your UI.
window, columnLayout, rowLayout, Button, frameLayout etc…
It will help you if you would like to edit something on the fly with a script.
I read your script and I asking to myself “why from the moon, he is editing something he didn’t give a name??”
Anyway.
Simple rule to remember is : You cannot edit a FrameLayout if you already attached some stuff to it.
If the button are children of you rowLayout, then you need to edit the rowlayout if you want to attach more buttons or edit each button’s label.
But now if you want to create a new buttons list, better for you to kill mister rowLayout (and bye bye to his children too) and then to build a new rowLayout.
But do not forget to parent it to the frameLayout. o_<
For that reason names are important!!
Look and try the following example :
window -title "testwindow" -width 600 -height 300;
columnLayout;
frameLayout -label "Checklist"
-collapsable true
-collapse true
-borderStyle "etchedIn"
frameLayoutCheckList;
rowLayout -numberOfColumns 6 rowLayoutCheckList;
text -label "StereoCamera";
text -label "1";
text -label "2";
text -label "3";
text -label "4";
text -label "5";
setParent ..;
setParent ..;
button -label "OK" -command "changeList";
showWindow;
proc changeList()
{
deleteUI rowLayoutCheckList;
rowLayout -p frameLayoutCheckList -numberOfColumns 6 rowLayoutCheckList;
text -label "A";
text -label "B";
text -label "C";
text -label "D";
text -label "E";
text -label "5";
}

|