Re: NSColorPanel question
Re: NSColorPanel question
- Subject: Re: NSColorPanel question
- From: Steve Christensen <email@hidden>
- Date: Mon, 18 Jan 2010 11:33:40 -0800
A bit of the crash log showing the backtrace and reason for crashing
would be much more helpful than just saying that it crashed.
Secondly, NSColorPanel is a floating panel so its behavior isn't
really oriented towards modally opening it, selecting a color and
closing it. You'd normally click in a NSColorWell and the NSColorPanel
would be made visible if it wasn't already. Then any changes made to
the color in the NSColorPanel are reflected in the NSColorWell.
The way you have it configured below, your action method is being
called every time the color changes if, say, you were dragging the
mouse over the color wheel or moving a color component slider. If you
were assuming that -changeColor: was being called once when the
"final" color was selected, you might be doing something to initiate
the crash.
On Jan 18, 2010, at 5:39 AM, Matthias Schmidt wrote:
Hello,
I'm a bit stuck with NSColorPanel, while trying to write a plugin for
another app, which should open the color picker, select a color, close
it and return the color.
I use this code here, but as soon as I click in the panel it is
crashing:
-(void)setPicker:(id)sender {
panel = [NSColorPanel sharedColorPanel ] ;
[ panel setColor: myColor ];
[ panel setMode: (NSColorPanelMode)pMode ];
[ panel setContinuous: YES ];
[ panel setTarget: sender ]; //myColor
[ panel setAction: @selector( changeColor:) ];
[ panel makeKeyAndOrderFront: nil ]; //self
}
I'd be happy, if someone could point me in the right direction
_______________________________________________
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