Hi thanx for your answer, I know it is an unusual place for setting the color. Putting the code in the awakeFromNib makes no difference for my problem. The color is not drawn in the NSColorWell until I click it. I have still no idea what this is all about.
Tobias ________________________________ Von: Quincey Morris <quinceymor...@earthlink.net> An: cocoa-dev@lists.apple.com Gesendet: Dienstag, den 30. Dezember 2008, 07:53:43 Uhr Betreff: Re: NSColorWell shows no color 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 (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/bool_pool%40yahoo.de This email sent to bool_p...@yahoo.de _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com