FROM : Jerry Krinock
DATE : Fri Feb 01 20:41:55 2008
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
DATE : Fri Feb 01 20:41:55 2008
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
| Related mails | Author | Date |
|---|---|---|
| Jerry Krinock | Feb 1, 20:41 | |
| glenn andreas | Feb 1, 21:47 | |
| Jerry Krinock | Feb 1, 22:18 | |
| glenn andreas | Feb 1, 22:44 | |
| Erik Buck | Feb 1, 23:49 | |
| Peter Ammon | Feb 2, 01:23 | |
| Erik Buck | Feb 2, 03:29 | |
| Ricky Sharp | Feb 2, 16:04 | |
| Jerry Krinock | Feb 4, 19:59 |






Cocoa mail archive

