Matt Gemmell

MGScopeBar

Show Author Marks ?

In need of some shiny new Cocoa source code? Then allow me to recommend MGScopeBar (which is actually from a project I started months ago, but I’m only just releasing it now so it’s new to you).

MGScopeBar provides a scope/filter bar like you’ll find in Mail, the Finder (in the Find/Spotlight window), iTunes and elsewhere. It requires Mac OS X 10.5 (Leopard) or later, and it looks like this:

It uses a delegate system very much like NSTableView’s data-source, and supports all kinds of snazzy things like optional icons for buttons, an accessory-view at the right side of the bar, button-groups which support single or multiple selection, and more. It also has a very cool feature which I call Smart Resize – take a look at the demo movie to see how it works.

You can get MGScopeBar from my Cocoa Source Code Subversion repository (see below if you don’t know how to do that), and you can find out more about it by reading the ReadMe file.

Lastly, if you’re feeling particularly grateful, may I be so bold as to mention the donation link on my Cocoa source code page and/or my rather nifty iPhone application, Favorites? Yes, I think I may.

How to get code from the Subversion repository

Just launch the Terminal application (it’s in /Applications/Utilities), paste the following command into the window (all on one line) and then press Return: svn checkout http://svn.cocoasourcecode.com/MGScopeBar ~/Desktop/MGScopeBar That command will checkout the latest copy of the source into a folder on your Desktop called “MGScopeBar”. The actual name of the folder is up to you, and you can then move that folder anywhere you like. Whenever you want to update to the latest version of the code thereafter, launch the Terminal application again and use the commands below. Note that there are two commands, and that they should be pasted into Terminal one at a time, pressing Return after each. Also note that you should obviously change the first command to use the actual path to wherever you’re keeping the code. cd ~/Desktop/MGScopeBar svn update If you want to find out more about Subversion, you can read the free online Subversion book.