Re: Action isn't sent
Re: Action isn't sent
- Subject: Re: Action isn't sent
- From: j o a r <email@hidden>
- Date: Sun, 4 Jul 2004 11:10:09 -0700
Are you asking why the action method is not called when you call
"setColor:" at the end of the "colorWellClick:" method? I don't think
that the action method is supposed to be called in response to a
programmatic setting of the color, only in response to a user action.
If that's not a problem you might try a different approach that I've
used. Set the action method on the color well instead of on the color
panel. When the color well is clicked it will per default open the
color panel and set it to have the same color as the color well - IIRC
- so you don't need to write extra code for that. When the color is
changed in the color panel, it's also changed in it's associated color
well, and at that time the action method on the color well is triggered
- allowing you to perform any custom logic you need at that time.
j o a r
On 2004-07-04, at 01.28, Bjvrn Carlstrvm wrote:
>
What's wrong with this code? I think its fairly straight forward but
>
the second method is never called from the colorPanel.
>
>
The code is called when a sheet with settings is displayed. Could the
>
use of a sheet interfere with how messages are sent?
>
>
- (IBAction) colorWellClick:(id) sender
>
{
>
NSColorPanel* panel;
>
>
panel = [NSColorPanel sharedColorPanel];
>
[panel setTarget: self];
>
[panel setAction: @selector (setIntExtTimeColor:)];
>
[panel setContinuous:YES];
>
NSColor* color;
>
>
// Code that sets the color
>
>
[panel setColor: color];
>
[panel makeKeyAndOrderFront: self];
>
}
>
>
- (void) setIntExtTimeColor:(id) sender
>
{
>
// I never reach this point!
>
}
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.