Re: NSColor (alpha enabling and setting color in color panel)
Re: NSColor (alpha enabling and setting color in color panel)
- Subject: Re: NSColor (alpha enabling and setting color in color panel)
- From: Aaron Boothello <email@hidden>
- Date: Thu, 2 Jan 2003 02:30:55 -0500
Hmmm..... it answers a couple of questions. Im kinda new to NSColorWell
and NSColorPanel.
I created an NSCOlorWell in IB by dragging the colorwell widget onto my
interface. i then connected it to an outlet in my program (colorwell1)
I wasnt aware of the differences between colorwell and panel but think
i got them now. i guess my next questions would be....
1)how do i create a colorPanel, and create an outlet for it ?
2)and well, the program im writing involves OpenGL, so i have an
NSColor object nsColor, and get the RGBA (no alpha yet) values from the
colorwell..... so i have the RGBA values, and want to set the color of
the well and panel using these RGBA values. is there a way i can do
that ?
Thanks.
On Thursday, January 2, 2003, at 12:57 AM, Bruce Veazie wrote:
You can set the color of both the colorwell (NSColorWell) and the
colorpanel (NSColorPanel) with "setColor:(NSColor *)colorToSet". Both
use the same method.
You can get the color of the selected text from [selectedText
textColor];
So:
[yourColorWellOrColorPanel setColor:[selectedText textColor]];
If the colorwell is active (the bezel is highlighted) and the
colorpanel is displayed, just set the color of the colorwell. The
panel will sync its color to it automatically.
Is that what you were looking for?
On Thursday, January 2, 2003, at 12:35 AM,
email@hidden wrote:
On Wednesday, January 1, 2003, at 05:25 PM, Aaron Boothello wrote:
1. How do you enable the Alpha value slider in the Color panel ?
From NSColorPanel.h:
- (void)setShowsAlpha:(BOOL)flag;
- (BOOL)showsAlpha;
2. How do you set the color of the colorwell/color panel ?
example: i select a different colored text in my document, with the
color panel open. i would like the color of the text to be selected
in
the color panel.
Not sure on this one...
-Ken
Bruce J. Veazie
email@hidden
http://veazie.org
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.