What paradigm behind NSColor's drawing methods?
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