Free Design Resources

October 18, 2006

For a lot of programmers, no matter what language or technology you’re working with the hardest part of developing an application isn’t just writing code, but making the end result look nice as well. Those of us who prefer an IDE to Photoshop are pretty much reliant on what we can find on the internet, and a lot of what’s out there is only available for a fee, or includes restrictive licenses. Good design work is worth paying for, but for those independent developers without any real budgets, there are a few free alternatives. Here are a few I’ve used in the past.

FAMFAMFAM Icons Over 1,000 very nice looking 16x16 px icons. They work great for websites, but are just as good for menu and toolbar icons in .NET programs. Cocoa applications use 32x32 px toolbar icons (or even higher, with resolution independence on its way), but you can still use them to spruce up a boring NSTableView.

Squidfingers Patterns Dozens of simple, elegant looking patterns that make a great backgrounds for any website or application. I’ve noticed one or two other OSX software websites using them in the past.

Matt Ball’s Royalty Free Icons I don’t know much about this designer, other than the fact that he posted some really nice 32x32 px OSX-ish toolbar icons on CocoaDev last year. The icon set includes many generic icons common to OSX applications, so you can quickly prototype a nice looking UI without resorting to stealing from someone else’s Contents/Resources directory.

Buildix, a pre-configured Subversion / Trac / Cruise Control server

October 18, 2006

I’m a huge fan of “pre-built” Linux servers, which let you jump right in to the fun of *nix software without worrying about installation or configuration. One I recently came across is Buildix, a Linux version control server running Subversion, Trac and Cruise Control. Although I haven’t really heard of many people using Cruise Control, Subversion and Trac are pretty much the de-facto standard for managing open source OSX projects.

Subversion is easy enough to set up on a fresh Linux install if you have some background knowledge, but in my experience Trac can be a pain. Buildix seems like a good solution for anyone who needs a source control server, but isn’t too experienced in Linux server administration.

How to tell when a window’s toolbar is shown or hidden

October 16, 2006

Do enough crazy visual stuff in Cocoa, and you might eventually want to manually move a UI element when an NSView changes its frame or bounds. For example, if you wanted a child window to float over a particular view in your main window. NSWindow will handle moving the child window along with the parent, but if the view you’re using as an origin can be dynamically resized, you’ll have to account for that yourself.

NSView has two useful notifications, NSViewFrameDidChangeNotification and NSViewBoundsDidChangeNotification, which are almost perfect; except for one special case. When the user shows or hides the window’s toolbar, the contents of the window will slide up or down, but you won’t receive any notifications from the NSView you’re trying to track. Of course, this is because the view’s frame and bounds didn’t really change; although the screen coordinates changed, NSView measures everything in the coordinate system of its superview (or the window’s internal coordinate system if it’s first in the view hierarchy).

The solution wasn’t obvious to me at first, but it’s actually very simple. Just register for NSWindowDidResizeNotification notifications from the window you want to track. They’ll be posted when the toolbar is shown or hidden, and you can update your UI from there. As a bonus, you might not even need notifications from the NSView anymore. If you only have one dynamically sized view in your window, the only time its frame will change is when the window changes as well.

CoRD: Cocoa Remote Desktop Client

October 11, 2006

CoRD Project Home.

CoRD is a remote desktop client for Mac OS X ported from the UNIX program rdesktop. It is a Universal Binary, and allows you to connect to multiple servers concurrently. There are many features not yet implemented, but it is usable in it's current form.

It’s currently in version 0.2, and it shows; I noticed a few bugs when I played with it, and the interface is pretty unrefined. Still, I could definitely see myself using it once it’s a little more mature. rdesktop on Linux has always seemed very full featured and stable, and although the Microsoft RDC application isn’t exactly terrible, it’s long overdue for a serious update.

Widget Manager 1.3.1

October 09, 2006

I’ve been focusing on Runner’s Log recently, but took a small break tonight to finish a new release of Widget Manager. It’s a small update, all bug fixes and such. Grab it here.

I have some neat ideas for the future of Widget Manager, and I expect once Runner’s Log 1.0 is finished I’ll start working on some new features. Keep an eye out!

Automatic grouping in NSUndoManager

October 07, 2006

From the NSUndoManager documentation:

All individual undo operations before a subsequent endUndoGrouping message are grouped together and reversed by a later undo message. By default undo groups are begun automatically at the start of the event loop, but you can begin your own undo groups with this method, and nest them within other groups.

I noticed this behavior for the first time today when adding objects from one collection to another, which happened to register a new undo action for each object. Since this was all done in a single pass through the run loop, NSUndoManager was smart enough to group these actions into a single undo operation.

There’s nothing wrong with this; for most situations it’s going to produce the correct result. When the user clicks a button or hits a key, it’s natural to expect that command will make one entry in the undo stack, even if your application performs several tasks behind the scenes. For the programmer, it can be a big time saver. You can register your undo action in an accessor method or through key-value observation, and not really worry about what triggered that change. The change could be part of some larger, more complex action, but you don’t need to worry about that, NSUndoManager will handle grouping by itself. Of course, if you really do want to break it down into multiple undo actions, it’s just one extra line of code. Neat!

Objective-C 2.0

October 03, 2006

Andy Matuschak on Objective-C 2.0:

Curious about what’s new in ObjC2? It’s pretty annoying being told “hey, we’re changing around the syntax of the language you do all your work in; hush, we’ll tell ya about it later” even when one has a seed key, so I looked around a bit. The secrets lie in Apple’s branch of gcc in the gnu.org repositories, where the changelogs are quite telling. Especially in the testing suites. So following is a list of ObjC 2.0 additions and places where you can see them in the repository.

I’ve been keeping an eye on Objective-C 2.0 since it was announced, as it more or less captures everything I like about working with C# on the Windows side of things. There are some features I’m a little critical of (garbage collection, for instance) but we’ll see how it goes.

Linux under Virtual PC 7

October 03, 2006

Over the weekend I spent too many hours trying to get a Linux server running under Virtual PC 7 for OSX. It was, frankly, a nightmare. I went through two distributions, different kernels, several installs, and in the end I was exactly where I started; it just didn’t work. It seemed like for each problem I solved, two more jumped out at me. Some were my fault, some were issues with Virtual PC, and some were problems with Linux itself (or the particular distribution I was using). In the end I finally got an NFS server up and running, but when I tried to mount it in OSX my system crashed, hard. Somehow this also managed to corrupt the virtual Linux server as well, to the point where it couldn’t even start the bootloader.

What I’ve love to have is a little virtual Linux server I carry around on my Powerbook and use for source control and a LAMP environment for testing changes to my website. I’d be able to access it anywhere, I wouldn’t have to worry about mixing up all those services with my day-to-day workstation environment, and it’s just a single file I need to worry about backing up. As long as I have my G4 though, I don’t think I’m ever going to get there. Part of me just wants to spend $500 or so on a nice, quiet bookshelf server for home, but I’m wondering if that money wouldn’t be better spent on a new Macbook Pro, where I could play around with some of the new Intel virtualization options and (just maybe) have better luck.

Steve Yegge on Agile Development

September 28, 2006

I read an interesting article from Steve Yegge today about agile development methodologies, and how things are done at Google. It’s interesting stuff, and tells a lot about why Google is a great place to work besides the usual “it’s that place place with the food and the swimming pools.”

Using rsync in OSX

September 28, 2006

Here’s my current rsync command, posted here so I can find it again in case I ever lose my bash history.


nice -n -20 rsync -aE --stats --progress --delete ~/ /Volumes/Firewire\ Disk/Backup/

To summarize, this copies all the files from my home directory to my firewire hard drive, ignoring files which haven’t changed since the last time I ran it, and deleting files which exist in the backup but not the original location. There’s nothing that’s not really explained in man rsync, but notice the sudo nice -n -20 command before it. That lets me keep on working or watching a movie, without rsync driving my poor G4 into the ground.

Mint Web Stats

September 26, 2006

I purchased Mint a week or two ago, and I have to say that for $30 it’s a steal. I’ve used a few other statistical packages over the years, and the only things they seem to be good at are the tools I don’t need. I know there are people out there who care, maybe even get excited about terms like “Visitor Segment Performance” and “Goals & Funnel Process”, but my business is software design. I have under a dozen total pages on my website at the moment, and all I want to know is how many people are looking at them, and what they’re saying about my products. Most statistics packages can’t even get that right; they snip the end off of dynamic URLs when reporting the referrer, making blog and forum URLs (perhaps the most important sources of information) useless to me.

Mint gets it all right. It’s an easy to use package that seems like it’s tailored for people like me. Everything it comes with by default is actually useful to me, and the tools it didn’t have were easy to add via its plugin system. On top of this, it manages to be beautifully designed as well. How many other website admin tools do you know that have their own official Dashboard Widget?

Measurement Units user preference in Cocoa

September 24, 2006

In OSX you can switch between U.S. and Metric units by opening up the International preferences in System Preferences. Accessing this value from your Cocoa application isn’t well documented, but it’s actually stored right in [NSUserDefaults standardUserDefaults] along with a lot of other localization info. It’s a boolean value with the key “AppleMetricUnits”, and as the name implies its value is true if the user selected metric measurement units in System Preferences.