Message 1 of 2
How to terminate a grid layout in MEL?

Not applicable
04-19-2020
02:18 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I'm trying to create a UI in Melscript. I would like to go from a 6x6 grid of buttons to a single column of buttons with a width of the total grid (so if each button in the grid is 70x70, the new button has a width of 420). However, I'm having trouble transitioning out of the gridLayout command.
I've tried defining the size of the grid array with the numberOfRowsColumns flag, but adding a new button just continues the grid. Same problem if I create a new grid that is 1x1. If I set autoGrow to false, the next button won't be added at all.
Here's what I have so far:
proc showTheWindow(){
int $dev = 0;
if ($dev && `window -exists "theWindow"`){
deleteUI -window "theWindow";
}
if (!`window -exists "theWindow"`){
window -title "Window" "theWindow";
columnLayout -adjustableColumn true;
separator;
gridLayout -numberOfRowsColumns 6 6 -cwh 70 70 -ag false;
for ($i = 0; $i<36; $i++){
button -label "Grid Button" -command (/*a secret function(i)*/);
}
separator;
button -label "Regular Button";
setParent ..;
showWindow "theWindow";
}
}
showTheWindow();
And here's a gorgeous MS paint illustration of what I would like to achieve. Any help at all would be appreciated.