Button Menu

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  09 September 2013
Button Menu

Hi all.

In a menuset, instead of having a button which opens a menu, is it possible to have a button to just run a command?

For example, I have a button next to the help menu. When I press the button it doesn't open a drop down menu but runs a command that opens a GUI.

Ta
 
  09 September 2013
Just hook up a command to the postMenuCommand and add no menuItems. The command will be called whenever you click the menu, but nothing gets shown. The command can then of course generate and show the UI.

import maya.cmds as mc

def myFunc(*args):
	print 'Create your GUI here'
	print 'These are the arguments that Maya passes by default: ', args

mc.window( menuBar=True, width=200 )
mc.menu( 'Click me', pmc=myFunc )
mc.showWindow()
 
  09 September 2013
Ok, thanks.

What I should have said is that I'd like this in the main maya UI.

So, I presume I need to make a file in the scripts > startup folder. Then, maybe edit the menuSetPrefs.mel file to load in the file.
 
  09 September 2013
error;

hi all
i'm six years experiance maya and yesturday i've face this wierd errore:// Error: displayString identifier "m_FileMenu.kProjectWindow" does not exist.

in the buttom line maya can't show up the project menu - file - project -set
new etc..
can someone now this ??
need help
thanks
 
  09 September 2013
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:07 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.