Source Lists feature in many Mac OS X applications. From iTunes to iCal to Versions, they are a great navigation control.
But for us Cocoa developers, they aren’t that easy to implement. You can easily create an
NSOutlineView and set its highlight mode to “Source List” but none of the other Source List features come built in out of the box, such as the ability to display badges or icons for items.
PXSourceList to help address this issue. It is a reusable control (within the context of Source Lists) compatible with Mac OS X 10.5 and higher. It makes implementing Source Lists in your applications easier by adding the following main features:
- Automatic Group highlighting of top-level items – the text for Group items appears in a dark blue colour and is normally displayed as capitalized.
- Support for Badges – these are dark blue capsules displayed to the right of certain items that display a number.
- The option to display an Icon for each row – a small image that provides extra visual information for each row.
- Right-clicking support to display context menus.
Getting the control
The source is available to download from GitHub, or you can clone it straight from the command line:
$ git clone https://github.com/Perspx/PXSourceList.git
More information about
PXSourceList is available from the project page.
There is also documentation available – a link to this can be found on the downloads page for the project on GitHub.
If you have any other questions then feel free to get in touch and I’ll be happy to help.