PDA

View Full Version : Layout issue - works in 2011, not in 2009 (MEL)


Horganovski
12-12-2012, 11:52 PM
Unfortunately this is something I can't test here as the oldest version of Maya I have is 2011, but someone who is using a script I wrote is having an issue with it in Maya 2009.
They get an error ' Too many children in layout: frameLayout8 //'

Here's the code (the start of it anyway) that builds the UI, it's the last line here that is causing the error. Any ideas as to why this doesn't work in Maya 2009?


// build the UI
if (`window -exists bhGhost`)
deleteUI bhGhost;
global string $theLayout;
window -toolbox 1 -rtf true -menuBar 1 bhGhost ;

menu -l "Colour" -to 1 optionsMenu;
menuItem -divider true;
$colorSel =`radioMenuItemCollection`;
menuItem -label "Black" -c bhBlackLine -radioButton off blk;
menuItem -label "White" -c bhWhiteLine -radioButton off wht;
menu -l "Help" -to 1 helpMenu;
menuItem -l "Show Help" -c bhHelpWin aboutlabel5;

columnLayout -adj 1 mainCol;


Cheers,
Brian

backwheelbates
12-13-2012, 04:50 AM
I couldnt get your code to work, but this code works in Maya 2012. Might have something to do with running the window command before you've added your UI elements.


string $window = `window -title "Long Name" -menuBar true -rtf true -toolbox 1 -widthHeight 200 55`;
menu -l "Colour" -to 1 optionsMenu;
menuItem -divider true;
$colorSel =`radioMenuItemCollection`;
menuItem -label "Black" -c bhBlackLine -radioButton off blk;
menuItem -label "White" -c bhWhiteLine -radioButton off wht;
menu -l "Help" -to 1 helpMenu;
menuItem -l "Show Help" -c bhHelpWin aboutlabel5;
columnLayout -adj 1 mainCol;
showWindow $window;


Also, Ive found that rowColumnLayout is completely unreliable, it might be the same for columnLayout as well. Its more work, but formLayouts are great and pretty consistent in my experience.

Horganovski
12-13-2012, 12:42 PM
Thanks, appreciate the ideas. I don't think it's that I'm creating the window before adding the elements though as if I don't do that they get added to another part of the UI instead.

I'll try converting it to a form layout instead and see if that works. It's a nuisance really as my code works fine in 2011,2012 and 2013 but not in 2009 apparently and I've no way to test here.

Cheers,
Brian

CGTalk Moderation
12-13-2012, 12:42 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.