Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacRumoron

macrumors 6502
Original poster
Sep 6, 2005
324
0
Lets say I have two images named ButtonUp and ButtonDown..

How would I subclass NSButton so that it uses the ButtonUp image when not pressed.. and shows the ButtonDown image when pressed?

Thanks in advance if anyone can help :)
 

caveman_uk

Guest
Feb 17, 2003
2,390
1
Hitchin, Herts, UK
Do you actually need to subclass. Can't you actually do this all in IB? I've not needed to do this buy my first guess would be use a rounded bevel button, change it's behavoir to Push On/Push Off and mess about with Icon and Alt. Icon in the inspector

Of course as I've never done this I could be totally wrong....:rolleyes:
 

MacRumoron

macrumors 6502
Original poster
Sep 6, 2005
324
0
that didn't work :(

it doesn't use the alt. image when you push down

thanks anyway...

anyone else know?
 

mrichmon

macrumors 6502a
Jun 17, 2003
873
3
MacRumoron said:
it doesn't use the alt. image when you push down

thanks anyway...

anyone else know?

Just did it. Set one image as the Icon, the second image as the Alt Icon, set the button behavior as "toggle". Where is the problem?
 

MacRumoron

macrumors 6502
Original poster
Sep 6, 2005
324
0
hmm... ok it works now..lol thanks guys

i had it set to "Momentary Push In" and it should be "Momentary Change" for it to use the alt. icon...

Thanks for the help ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.