Hi Marcus,

I have not tried that yet. To get a better understanding, I assume that if 
we use the cmds module to build menus, it creates Qt items "in the 
background" for us. I guess we need a way to reference theese objects to 
use Qt functionality?  Would I use "omui.MQtUtil.findControl(widgetStr)" or 
similar?

It would be great if you could post a working snippet of how to add a menu 
to the main menu with the desired functionality.

Best Regards,
Johan

On Friday, July 11, 2014 1:59:42 PM UTC+2, johan Borgström wrote:
>
> Hi!
>
> I am building a basic menu populated with some menuItems. I want the user 
> to be able to add and remove menuItems to the menu. I have wrapped the menu 
> in a class and written some methods to help to add and remove menuItems. I 
> do not want to write a special ui to handle the removing of items, so my 
> idea is to check if the user holds a modifier key while clicking the 
> menuItem and if so delete it. Another idea is to use a right click popup 
> menu on the menuItem and have the option "delete item".
> To add the command to the menuItem I use functools.partial. So to wrap it 
> up my questions are:
>
>
>    - How can I add a right click popup menu to a menuItem.
>    - How can I check if a modifier key was pressed when the menuItem was 
>    clicked.
>
> Best Regards,
> Johan
>
>
>

-- 
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/c9057d58-27d0-4aa6-bae7-ac3d2d043eac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to