Hi,

I changed the place of the initialization now. Still no difference.. The colors 
are valid. I checked this and also tried with predefined colors like [NSColor 
greenColor]. It seems a very strange problem to me. So am I right if I think, 
the colors should be drawn after they are set? Would make sense I my opinion.

Tobias  




________________________________
Von: Graham Cox <graham....@bigpond.com>
An: tobias assmann <bool_p...@yahoo.de>
CC: cocoa-dev@lists.apple.com
Gesendet: Dienstag, den 30. Dezember 2008, 11:48:51 Uhr
Betreff: Re: NSColorWell shows no color


On 30 Dec 2008, at 9:40 pm, tobias assmann wrote:

> I know it is an unusual place for setting the color.


It's not unusual, it's wrong.

When the colour well's setColor: method is called, one thing it will do is 
invalidate itself by calling setNeedsDisplay: which will cause drawRect: to get 
called again, and so on - an infinite loop, potentially. I suspect Cocoa takes 
steps to protect itself against this sort of thing by ignoring or suppressing 
updates flagged from within drawRect: which may be why you don't see anything 
happen until a click.

Moving the set up to awakeFromNib is definitely more correct though if it's 
still not working then there's clearly something else going on. Are you sure 
the colours in the colour list are valid?

--Graham



_______________________________________________

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

Reply via email to