Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSButton

NSButton
Thread Tools
Mac Elite
Join Date: May 2002
Location: New York City
Status: Offline
Reply With Quote
May 11, 2003, 09:30 PM
 
I need a little help here.

How do I draw an NSButton using three images?

For example, in iPhoto, the Import, Organize, etc. buttons are actually three separate images functioning as a single button.

Any suggestions?
Thanks.
(Last edited by zachs; May 23, 2003 at 01:53 AM. )
     
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
May 11, 2003, 10:35 PM
 
yeah, i wanna know to

there is the DOWN, UP, and INACTIVE state for the buttons

how do you do that?

I DEMAND TO KNOW AS WELL!
     
Senior User
Join Date: Dec 2001
Status: Offline
Reply With Quote
May 11, 2003, 11:24 PM
 
Originally posted by Nebagakid:
yeah, i wanna know to

there is the DOWN, UP, and INACTIVE state for the buttons

how do you do that?

I DEMAND TO KNOW AS WELL!
Nebagakid, you are not only a jerk, but an idiot as well.

The types of buttons used in iPhoto (the "plastic" ones) are made up of a lot of images. There are normal, pressed, selected, and disabled states for each, and each of those has a left cap, right cap, left divider cap, right divider cap, and a "stretch" piece. That's 20 images in all. To make these in your own app, you'll need to subclass NSControl and NSCell and draw your buttons manually. Why not just use normal buttons?
"Think Different. Like The Rest Of Us."

iBook G4/1.2GHz | 1.25GB | 60GB | Mac OS X 10.4.2
Athlon XP 2500+/1.83GHz | 1GB PC3200 | 120GB | Windows XP
     
Banned
Join Date: Apr 2002
Location: -
Status: Offline
Reply With Quote
May 12, 2003, 03:57 PM
 
Originally posted by Nebagakid:
yeah, i wanna know to

there is the DOWN, UP, and INACTIVE state for the buttons

how do you do that?

I DEMAND TO KNOW AS WELL!
uh? NSButtons do that too. relax man.
     
Mac Elite
Join Date: Sep 2000
Location: 'round the corner
Status: Offline
Reply With Quote
May 12, 2003, 06:54 PM
 
Originally posted by ambush:
uh? NSButtons do that too. relax man.
but these are custom non-system wide buttons
     
Banned
Join Date: Apr 2002
Location: -
Status: Offline
Reply With Quote
May 12, 2003, 07:08 PM
 
Originally posted by Nebagakid:
but these are custom non-system wide buttons
Nope. I've seen non subclass implementation on the net.

http://www.buzzlabs.com/aquataxx/
     
Mac Enthusiast
Join Date: Apr 2001
Location: 127.0.0.1
Status: Offline
Reply With Quote
May 13, 2003, 07:00 AM
 
Originally posted by ambush:
Nope. I've seen non subclass implementation on the net.

http://www.buzzlabs.com/aquataxx/
Kinda OT but...

Wow... thanks for that link! I followed it and found it to be a very cool game with full source code. The best part -- the source is Java + Cocoa. The game is *very* slick and is a great example of what can be accomplished by mixing Java & Cocoa.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:32 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2