Ah I found this snippet that seems like what I need...
def clearList(self, *args):
menuItems = cmds.optionMenu('optionMenu', q=True,
itemListLong=True) # itemListLong returns the children
if menuItems:
cmds.deleteUI(menuItems)
On Wed, Apr 23, 2014 at 10:44 AM, Tim Crowson <[email protected]> wrote:
> I have a submenu whose contents I want to update, but I don't want to
> change the position of the submenu in its parent menu. I'm assuming that
> deleting the submenu and recreating it would recreate it at the *end *of
> the parent menu (?)....
>
> But I'm curious if I can use *cmds.deleteUI()* with the *menuItems *flag,
> but instead of specificying which menuitems I want to delete... just delete
> all the menuitems instead. The only flags I see for that method are
> object-specific. Is there a way to loop over menuItems and delete each one
> perhaps?
>
> -Tim
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPh%3D1bnqhFDst21RcrFgTcHVv6xZoGHHLFkKMg7-9%2B%3DShOH%2BfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.