• 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
What paradigm behind NSColor's drawing methods?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What paradigm behind NSColor's drawing methods?


  • Subject: What paradigm behind NSColor's drawing methods?
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 1 Feb 2008 11:41:55 -0800

I've always been amazed by -[NSColor set], which "Sets the color of subsequent drawing to the color that the receiver represents".

This seems absurd. Instead of affecting the receiver, the receiver is affecting some other object, and the identify of the affected object is not even hinted at.

Instead, I would expect there to be a method like like:

    -[NSGraphicsContext setColor:(NSColor*)]

and then you could also have a getter (and I cannot find a real-life equivalent of this),

    -(NSColor*)[NSGraphicsContext color]

I've just re-read the Cocoa Drawing Guide but still can't comprehend the paradigm behind NSColor's -set, -setFill, -setStroke etc. Can someone please straighten me out? Or are these methods the unfortunate legacy of some bad decision made 15 years ago?

Jerry Krinock _______________________________________________

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


  • Follow-Ups:
    • Re: What paradigm behind NSColor's drawing methods?
      • From: Peter Ammon <email@hidden>
    • Re: What paradigm behind NSColor's drawing methods?
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: memory management issue?
  • Next by Date: The NSTrackingArea Report
  • Previous by thread: Re: CoreData and NSOperation
  • Next by thread: Re: What paradigm behind NSColor's drawing methods?
  • Index(es):
    • Date
    • Thread