On Dec 4, 2009, at 9:56 AM, Matt Neuburg wrote:

I have a vague feeling that, once again, it's a nomenclature thing. It
should really have a name that makes clear you're setting something about
the graphics context (like setForContext or something)...

In this context <sic> "set" means "set the receiver to be used by the current graphics context". There are a couple of graphics-related classes that have this method.

I don't like this design, as it's not very object-oriented and relies on global state (the "current context"). It would be better to have a - setColor: method on NSGraphicsContext. It's been in AppKit forever, though, and I think it came from the PostScript model, where there is always a global graphics context that all operators implicitly refer to. In the newer CoreGraphics APIs (that replaced Display PostScript), they switched to making context an explicit parameter of every drawing call.

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to