Re: NSColorWell----please help
Re: NSColorWell----please help
- Subject: Re: NSColorWell----please help
- From: Martin Wierschin <email@hidden>
- Date: Wed, 7 Jan 2009 01:55:08 -0800
After activating the colorwell ,if we select any colors from that
colorwell
The backgroundcolor changes and the foregroundcolor changes to the
same
color if we type.
As mentioned, the easiest is to override "changeColor:" in a
NSTextView subclass. Others have done it:
http://www.cocoabuilder.com/archive/message/cocoa/2007/12/13/194848
I want the colorwell to act ,only when any color from it is selected,
Not at the time of activation .
This is an annoyance of NSColorWell, and my solution was to create a
NSColorWell subclass that overrides "activate:" to set a flag you can
test later to ignore the "changeColor:" action, eg:
@implementation MYColorWell
- (void) activate:(BOOL)isExcl
{
// the very first click on a color well normally sends its action
[NSColorPanel beginDisableAllColorActions];
[super activate:isExcl];
[NSColorPanel endDisableAllColorActions];
}
@end
It's not pretty, but the color panel is a shared resource anyways,
and it does the job.
~Martin
_______________________________________________
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