Mel - Maya Embedded Language

Use the gridLayout to add your command in a grid fashion across your window.

-gridlayout
-nrc/numberOfRowsColumns int int
-nr/numberOfRows int
-nc/numberOfColumns int
-cwh/cellWidthHeight int int
-cw/cellWidth int
-ch/cellHeight int

// create a window using a grid with buttons in it
// buttons report back to the user which button they pressed through the proc what().

proc what(int $num)
{
string $mybutton[ ] = {"one","two","three","four","five","six"};

print ("\nYou thought you would get away with pressing button "+ $mybutton[$num -1]);

}


if (`window -exists ted`)
	{
	deleteUI ted;
	windowPref -remove ted;
	}

window -widthHeight 234 70 ted;

gridLayout 
	-numberOfRowsColumns 2 3
	-cellWidthHeight 75 20;

button -label "b1" -command "what(1);";
button -label "b2" -command "what(2);";
button -label "b3" -command "what(3);";

button -label "b4" -command "what(4);";
button -label "b5" -command "what(5);";
button -label "b6" -command "what(6);" lastButton;

showWindow ted;
Exercise: Try to create a wondow that looks like the following: Each button should make a different shape and move it.