Dethe Elza •
Feb 9, 2005 • 2 min read
Is that a banana in your email, or are you happy to see me?
I’ve gotten a couple of messages asking why there are strange attachments in my email which may or may not prompt you to open your security settings if you try to open them. Fear not, these are not viruses! Rather, it’s the basis of email itself if we ever want to move beyond the ocean of spam we currently swim in.
Read →
Dethe Elza •
Jan 29, 2005 • 2 min read
Extending NSBezierPath
Yesterday I wrote about how to extend NSImage so it can save to a file. Today we’ll tackle NSBezierPath. NSBezierPath is pretty cool for drawing, but it doesn’t support arbitrary regular polygons, just rects and ovals (and lines and arcs). And there’s not an easy way to extract the points that make up a path. And if you could extract the points, there isn’t a way to draw dots for the points instead of stroking or filling the path. OK, enough already, let’s look at some code.
Read →
Dethe Elza •
Jan 25, 2005 • 2 min read
Extending NSImage
I’m going to try to post smaller snippets and experiments, more frequently. I’ve been struggling with creating images in code for a game I’m working on and had some successes lately that I wanted to share. Along the way we get to play with Categories, which allow existing Cocoa classes to be extended with new methods at runtime without access to the source code. Categories are in the latest release of PyObJC, but the example I’m giving uses a fresh checkout from the Subversion repository because I turned up a bug which Ronald Oussoren was kind enough to identify and immediately fix. Since this example is already on the bleeding edge, I’ll also dabble with Python2.4 descriptors.
Read →