Programming UI: Problem!

Hi,
What do I have to do in order to parent a tabLayout to a FrameLayout??
here is my approach but it gives me an error message:


window -widthHeight 200 150;
string $main = formLayout;
string $tabs = tabLayout -innerMarginWidth 5 -innerMarginHeight 5;

        formLayout -edit
    		-attachForm $tabs "top"    0
 		-attachForm $tabs "left"   0
 		-attachForm $tabs "bottom" 0
 		-attachForm $tabs "right"  0
 		$main;

 	//string $child1 = `rowColumnLayout`;
 	 string $child1 = `formLayout`;
 	 	string $b1 = `button`;
 		string $b2 = `button`;	
 		string $frame1=`frameLayout -la "top" -bs "in" -cll true`; //This DOESN'T WORK [img]http://208.179.92.68/forums/icons/frown.gif[/img]

		setParent ..; 		

 	formLayout -edit
 		-attachForm $b1 "top" 0
 		-attachForm $b1 "left" 0
 		-attachPosition $b1 "right" 0 50
 		-attachForm $b1 "bottom" 0

 		-attachForm $b2 "top" 0
 		-attachControl $b2 "left" 0 $b1
 		-attachForm $b2 "right" 0
 		-attachForm $b2 "bottom" 0
 		-attachForm $frame1 "top" 20	 			 		
 		$child1;




 	string $child2 = `formLayout`;
	 	string $b3 = `button`;
 		string $b4 = `button`;
 		 setParent ..;

 	formLayout -edit
 		-attachForm $b3 "top" 0
 		-attachForm $b3 "left" 10
 		-attachPosition $b3 "right" 0 45
 		-attachForm $b3 "bottom" 0

 		-attachForm $b4 "top" 0
 		-attachControl $b4 "left" 10 $b3
 		-attachForm $b4 "right" 10
 		-attachForm $b4 "bottom" 0
 		$child2;


 	tabLayout -edit
 		-tabLabel $child1 "One"
 		-tabLabel $child2 "Two"
	$tabs;

I get the following error message:
Object is not a child: MainWindow|formLayout147|tabLayout7|formLayout148|formLayout149


May be somebody could help!!

Cheers
Mel

I don't have Maya in front of me right now, but my initial impression is that this is going to be tracked down to not having enough setParent..; commands in the right places. Every time you go a level deeper in a UI by adding another layout type, you need to make sure you step back up with setParent. My initial guess would be before the $child2 formLayout.

I will try and remember to fire this up in Maya tomorrow at the office and see if I can get it to run.

--JeffD

You've probably solved this already, but if not:

I find the easiest way not to get my SetParents in a twist is to use the "-p" flag to make sure that my layouts have the correct parents. I tried out what you pasted, and could make it work by setting the parenting like this.

Carmine
xxxxxxx