• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
sharedColorPanel question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sharedColorPanel question


  • Subject: sharedColorPanel question
  • From: Aaron Boothello <email@hidden>
  • Date: Fri, 2 Mar 2007 11:01:10 +0900

I use a contextual menu to bring up the shared color panel in order to change a particular attribute in my application. the code is as follows....

//-----------
- (IBAction)changeBackgroundColor:(id)sender
{
[[NSColorPanel sharedColorPanel] makeKeyAndOrderFront:self];
[[NSColorPanel sharedColorPanel] setTarget: self];
[[NSColorPanel sharedColorPanel] setAction:@selector (changeColor:)];
}
-(void)changeColor:(id)sender
{
float colors[4];


    colors[0]= [[[sender color] retain] redComponent];
    colors[1]= [[[sender color] retain] greenComponent];
    colors[2]= [[[sender color] retain] blueComponent];
    colors[3]= [[[sender color] retain] alphaComponent];
}
//-------------

The problem arises when, in another part of the application, i use a colorWell to change the color of another attribute. the target and action remain unchanged(as above), and so these two different colors change simultaneously. How do i correct this ?

Thanks,
Aaron
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: sharedColorPanel question
      • From: Bob Smith <email@hidden>
  • Prev by Date: Re: Preventing application from becoming active (SOLVED)
  • Next by Date: Re: sharedColorPanel question
  • Previous by thread: Re: Using NSTextView's delegate method textView:draggedCell:inRect:event:atIndex: selectively
  • Next by thread: Re: sharedColorPanel question
  • Index(es):
    • Date
    • Thread