Re: NSColorWell shows no color
Re: NSColorWell shows no color
- Subject: Re: NSColorWell shows no color
- From: Quincey Morris <email@hidden>
- Date: Mon, 29 Dec 2008 22:53:43 -0800
On Dec 27, 2008, at 02:13, tobias assmann wrote:
I use some NSColorWell objects in a preference section of my view.
User can chosse so me colors there. All works fine exept one thing.
The NSColorWell objects are initialized with default values out of a
NSColorList when the UI is opened. But the NSColorWell objects show
the color white. When a NSColorWell is clicked the color that is
supposed to be selected shows up in the NSColorWell and the default
selctor as well. It would be nice to see the color, without the need
to click NSColorWell. I have really no idea what my be wrong. This
is the code, which I use in the draw method of the view containing
the NSColorWells:
// Fill the colorWells
[uiBgColorWell setColor:[topv..colors colorWithKey:@"bg"]];
[uiBlinkColorWell setColor:[topv.colors colorWithKey:@"blink"]];
[uiActivBeatColorWell setColor:[topv.colors
colorWithKey:@"activeBeat"]];
[uiInactiveBeatColorWell setColor:[topv.colors
colorWithKey:@"inactiveBeat"]];
In the draw method of a view? As in drawRect? That seems like the
wrong place to do this.
If you're initializing the colors when the view first appears, then
the view's awakeFromNib method would be the usual place to do it. It
doesn't seem like you'd want to do this more than once anyway.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden