[ 2003-May-28 15:47 ]
Some of Apple's iApps, such as iPhoto, and Safari, have tables and outlines with alternating blue backgrounds. This appearance is not trivial to duplicate. Some attempts have been tried before, but the best approach is to create subclasses. iAppTableView and iAppOutlineView are NSTableView and NSOutlineView subclasses that attempt to duplicate Apple's control appearance.
Download iAppViews disk image
iAppViews Demo Application
iAppTableView/iAppOutlineView Features
- Completely compatible with NSTableView or NSOutlineView
- As subclasses, iAppTableView and iAppOutlineView support the same features and interfaces as NSTableView and NSOutlineView. Adding iApp coloured rows to your program is as easy as replacing the Application Kit class with the iApp version.
- Unrestrictive open source licence (LGPL)
- You get all the source code, and can use the classes in commercial or noncommercial projects. The only restriction is that if you make any changes to the source code, you must make the code to those changes available. For more detail, read the actual LGPL licence itself. If these terms are too restrictive, contact me and I will be happy to negotiate an alternative with you.
How to use iAppTableView/iAppOutlineView
- Download the code.
- Add
iApp*
to your project.
- Replace your NSTableView/NSOutlineView class with iAppTableView/iAppOutlineView. This can be done inside Interface Builder by importing the .h file and then going to the "custom class" pane of the table view's information window.
- Build and run. Please report any problems.
Files
- iAppViews.dmg.bz2
- Includes the compiled demo application and the complete source code.
Related Links
- iTableView - An NSTableView subclass that goes further in duplicating the appearance by using colours from the System Preferences. However, there is no outline version.
- CocoaDev's AlternatingRowColors page - A discussion about how to implement this effect.
- RowResizableViews - NSTableView and NSOutlineViews with variable row heights.