PDA

View Full Version : menuItemīs "-collection" flag?


dwalden74
05-23-2003, 05:19 PM
Hi guys-

I need some help understanding the "-collection" flag in the menuItem command.

I have a script which is dynamically adding menuItems with submenus to a popup menu (it adds menuItems based on cameras and image planes found in the scene). However, Iīm getting errors (only sometimes, strangely) with these submenu menuItems: "Error... : Collection not found, or no current collection."

When the error occurs, it is found in a line that contains a menuItem with a radioButton. I was looking again over the menuItem flags in the MEL docs, and saw the "-collection" flag, although there are no examples of this flag, and the definition of this flag is "-cl/collection string: To explicitly add a radio menu item to a collection." What does that mean? Apparently I should create a collection somewhere and add the menuItems to this collection, but where and how???

:beer:
David

mark_wilkins
05-23-2003, 08:07 PM
A collection is an object that binds a group of radio buttons together so that when one turns on, the others turn off. Have a look at the radio button examples in the documentation, then be sure to make a collection object prior to your radio button menu items. Put the menu items in the collection at creation time with the -collection flag and that's all there is to it.

-- Mark

dmeyer
12-17-2003, 12:20 AM
Is it possible to have a button that deselects all the radio buttons in a given radioButtonGrp?

I have an interface tab with several groups of radio buttons, and I'd like to have one "Master Reset" button to return them all to their default, unselected state.

At this time the radioButtonGrp's are not explicitly placed in a collection.

ie:
----------------------------------
columnLayout -columnWidth 338 -height 312 -width 338`;

radioButtonGrp
-numberOfRadioButtons 2
-label "Blah"
-labelArray2 "Blah1" "Blah2"
------------------------------------------------------------------

Thanks

macaroniKazoo
12-17-2003, 01:13 AM
david: to create a radio button collection, just use:

radioCollection someSortOfName;

and then when you create a radion button, just use:

radioButton -l "oh yeah!" -cl someSortOfName;

hope that helps ya!

brubin
12-17-2003, 01:39 AM
@dmeyer

Originally posted by dmeyer
Is it possible to have a button that deselects all the radio buttons in a given radioButtonGrp?



by the nature of radiobuttons that is not possible; you can do it with checkboxes though; an example how to make that work you can find in this thread:
http://www.cgtalk.com/showthread.php?threadid=106829


HIH
s

CGTalk Moderation
01-15-2006, 06:00 AM
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.