PDA

View Full Version : How to Change a Button's Image


ozioz
07-25-2012, 08:45 AM
Hi;

I hope that my question does not sily . But I could not manage this simple task .

I want to change my buttons overall look by selecting an image and I also want this button to change its image depending on mouse action ..

I tried to go along with the simple tuts in MEL command help page but I have not been able to get anything so far.

Best Regards ;

Ozan

NaughtyNathan
07-25-2012, 09:56 AM
what kind of button? a standard "button" doesn't support images at all, and the only button type that supports different state icons are the iconTextButton and it's relatives.

if you have a button that already exists and you want to change any property on it, all you need to know is it's name, then use the -edit flag:

symbolButton -edit -image "c:/icons/destroy.bmp" myButton1;

ozioz
07-25-2012, 10:01 AM
Thank you so much NaughtyNathan;

Then , How can I specify the other states of the button ?

Like mouse over , pressed and the other stuff..

Is it done automatically ?

NaughtyNathan
07-25-2012, 12:00 PM
you can't, unless it's an iconTextButton, and then you just specify a different image for each of it's states. just take a look in the MEL docs for this command.

ozioz
07-25-2012, 12:04 PM
I did man .. I took a look at the MEL help pages for " iconTextButton " command ..

I will use this command OK .. That is for sure .. Thanks for the help ..

But there is nothing saying how to apply three stages of the button image in help pages..

"image1" "image2" and "image3" flags were the only thing that I could see ...

Is it What I am looking for ?

If you can write something simple for me, I will never nag you again..

Best Regards;

Ozan

NaughtyNathan
07-25-2012, 12:16 PM
dude... it's all right there:

-disabledImage (-di) string
Image used when the button is disabled. Image size must be the same as the image specified with the i/image flag. This is a Windows only flag.

-selectionImage (-si) string
Image displayed while the control is selected. Image size must be the same as the image specified with the -i/image flag. This is a Windows only flag.

-highlightImage (-hi) string
Highlight image displayed while the cursor is over the control. Image size must be the same as the image specified with the -i/image flag. This is a Windows only flag.

ozioz
07-25-2012, 12:27 PM
NaughtyNathan

I do not know how to apologize .. Sorry to bother you like that ..

But sometimes things might get less visible when you do not know What to look for ..

You have been so helpfull ..

Thanks Again

Best Regards

Ozan

NaughtyNathan
07-25-2012, 01:07 PM
no need to apologize dude, if it was a bother at all I simply wouldn't have bothered to reply. Better to give you a push in the right direction than simply hand you a line of code you may then not know how to adapt later, especially as this post may also serve to help someone else in the future.

CGTalk Moderation
07-25-2012, 01:07 PM
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.