Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 6, 2006, 02:24 PM   #1
MacRumoron
macrumors 6502
 
Join Date: Sep 2005
NSButton Subclass

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
__________________
I am the MacRumoron
Click Here For Proof Told you I'm a moron..
MacRumoron is offline   0 Reply With Quote
Old May 6, 2006, 03:19 PM   #2
caveman_uk
Guest
 
caveman_uk's Avatar
 
Join Date: Feb 2003
Location: 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....
caveman_uk is offline   0 Reply With Quote
Old May 6, 2006, 05:08 PM   #3
MacRumoron
Thread Starter
macrumors 6502
 
Join Date: Sep 2005
that didn't work

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

thanks anyway...

anyone else know?
__________________
I am the MacRumoron
Click Here For Proof Told you I'm a moron..
MacRumoron is offline   0 Reply With Quote
Old May 6, 2006, 05:41 PM   #4
mrichmon
macrumors 6502a
 
Join Date: Jun 2003
Quote:
Originally Posted by MacRumoron
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?

Last edited by mrichmon; May 6, 2006 at 06:13 PM.
mrichmon is offline   0 Reply With Quote
Old May 6, 2006, 06:08 PM   #5
MacRumoron
Thread Starter
macrumors 6502
 
Join Date: Sep 2005
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
__________________
I am the MacRumoron
Click Here For Proof Told you I'm a moron..
MacRumoron is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Add elements to View from subclass Pades iPhone/iPad Programming 1 May 9, 2014 06:51 AM
Subclassing a subclass - question regarding IBOutlets and IBActions moonman239 iPhone/iPad Programming 1 Sep 27, 2013 08:15 PM
Set label title from mouseEntered: on a NSButton Val K Mac Programming 1 Jun 19, 2013 03:39 AM
Resolved: Trying to subclass NSView Hans Kamp Mac Programming 9 Mar 25, 2013 04:43 PM
Trying to subclass UIView Hans Kamp iPhone/iPad Programming 3 Mar 25, 2013 12:15 AM

Forum Jump

All times are GMT -5. The time now is 05:37 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC