View Full Version : frameLayout -cc command

12 December 2003, 05:56 PM
i do a degree in 3d animation at university and have a project to create a mel script that allows users to configure options for a product.
This may sound unclear but i have chosen to do a cocktail maker. they select alcohol/mixers/glass etc to make the drink.
This may sound like a pointless use of mel (the project that is) but none the less i have to do it.

my problem occours when i try to edit the -ann flag of a frameLayout using the -cc flag.
i'm not sure how to get it to edit the mouse over text from "click to collapse" to "click to expand" when the frame is collapsed.

here is my code (its may be rubbish, inefficient etc but i'm learning so bear patient)

string $drinkS = `frameLayout -l "Drinks" //drinks main menu
-borderStyle "etchedOut"
-cll true
-mw 6
-mh 3
-ann "click to collapse"
-cc -e (-ann "click to expand")`;

i'm not sure of the structure for both the -cc command and the -edit command.
this is probably a very basic mistake.

12 December 2003, 10:46 PM
to edit UI controls, you have to specify an object name. its just like working with objects really. so when you build your control, either give it a name, or store its name in a variable.

maya returns the UI object name when you create a control, which it looks like you already know. :)

so, to get your thing working, you'd do something like this:

frameLayout -l "Drinks"
-cll true
-mw 6
-mh 3
-ann "click to collapse"
-cc "toggleAnn drinksFrame"
-ec "toggleAnn drinksFrame" drinksFrame;

global proc toggleAnn( string $UIObject ) {
if( `frameLayout -q -collapse` ) frameLayout -e -ann "click to expand" $UIObject;
else frameLayout -e -ann "click to collapse" $UIObject;

hope that helps. :thumbsup:

CGTalk Moderation
01 January 2006, 11:00 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.