View Full Version : Two questions about buttons

02 February 2011, 11:54 PM
So I've been making a character GUI lately, and one of the things I would like to be able to do is have shift-select and control-select functionality for the controls on the character. I've seen this in scripts but haven't been able to figure out how they did it. I tried using the -doubleClickCommand flag with an iconTextButton, but I'd rather have that shift and control select functionality instead, namely with regular old buttons.

The other thing I want to do is change the actual button when the mouse moves over it. This should be possible in at least 2011 with the new Qt UI, because the button noticeably changes ever so slightly when you mouse over. But I simply couldn't find any commands or flags that relate to the mouse position and whether or not it's over a button. So I'm thinking this is something that is being done under the hood, and that we don't have access to, which is unfortunate.

Any thoughts on either of these two issues is appreciated in advance.

02 February 2011, 12:48 AM
for question 1, this looks like it might be what your after. (
i'm not too sure about the docs for this command, the example didn't seem to work. (bit value?).

not sure about q 2. sorry.

02 February 2011, 01:56 AM
Sweet, that helps, thanks.

Thoughts on the second one are still appreciated.

02 February 2011, 10:22 AM
did you actually read the docs for iconTextButton?! :D ;)

-highlightImage (-hi)
Highlight image displayed while the cursor is over the control
This functionality has been around since Maya 1.0 (probably ;) )

02 February 2011, 03:01 AM
No Nathan, because I'm looking for that same functionality but for regular buttons. The difference is that I don't need an image, but for example I would need the button to change color. Besides the fact that it is a Windows only flag, which doesn't do much good.

I suppose if it works, I can't complain though.

02 February 2011, 04:17 PM
To change that you would need to use PyQt/Qt, Maya only allows you to change the background color, not the highlight color. A Qt stylesheet would can do it pretty simply.

02 February 2011, 05:17 AM
you can do that with pyqt, subclass button and override the mouse events.

Sweet, that helps, thanks.

Thoughts on the second one are still appreciated.

02 February 2011, 06:24 AM then the question becomes how do I access PyQt classes from within Maya? Is it built in?

02 February 2011, 06:28 AM
PyQt is not built in unfortunately. I have pre-compiled versions to use with Maya 2011 on my website:
PyQt Maya x86 (
PyQt Maya x64 (

CGTalk Moderation
02 February 2011, 06:28 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.