Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   shelfButton command (https://simplymaya.com/forum/showthread.php?t=21889)

Dann 08-06-2006 06:54 PM

shelfButton command
 
I know I've used this command before, but I can't get it to work today. According to the Maya docs, the following should make a button.
shelfButton -annotation "Print \"Hello\"."
-image1 "commandButton.xpm" -command ("print \"Hello\\n\"");

It doesn't work. It needs to know the parent to know which shelf to put it in. Can anyone remember how to query the active shelf?

Thanks.


*** EDIT :attn:
How came after struggling with something and finally decideing to post looking for help, I always find the solution on my own minutes later?

global string $gShelfTopLevel;
if (`tabLayout -q -isObscured $gShelfTopLevel`) error -sl on "Please make a shelf visible.";
-parent (`tabLayout -q -selectTab $gShelfTopLevel`)

skywola 09-06-2006 01:26 AM

Experientia docet - - - Experience teaches

I have found that the more I have learned about MEL, the more often I am able to solve my own problems with coding . . . so I guess that is a good sign for you. . . :alien:


All times are GMT. The time now is 09:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018