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 > Elementary Cocoa Question regarding Color

Elementary Cocoa Question regarding Color
Thread Tools
Mafia
Mac Elite
Join Date: Jun 2003
Location: Alabama
Status: Offline
Reply With Quote
Oct 7, 2005, 01:51 AM
 
hey guys,
i'm relatively new to cocoa but not oop. so i have experience programming just not in the objective c language. so heres what i want to do. i have a drawRect function that draws onto a vew on the window. Now i can set the color that it draws individually by using
Code:
[[NSColor blueColor] set];
but what i'd like to do is to let the user select the color using a NSColorWell. i have the NSColorWell layed onto the interface but how do i replace that "blueColor" with the active color of the NSColorWell. All help would be greately appreciated. thanks.

mafia
http://www.mafia-designs.com
     
Chuckit
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 7, 2005, 03:07 AM
 
NSColorWell has a color method that you can use to get the NSColor it's set to. So…

Code:
NSColorWell *well; // Assume this points to your color well. [[well color] set];
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
   
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
Top
Privacy Policy
All times are GMT -4. The time now is 03:07 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,