Hi list,
Leopard has the ability to specify that an outline view is a source
list, but what I haven't figured out, is how to replicate the
headings (e.g. "DEVICES" in Finder). I could of course return an
NSAttributedString to the outline view, but I get the feeling that's
the wrong way to do it (TM). I then have to guess what styles the
text should have, and as soon as apple update, it will look odd.
Can anyone recommend to me what the right way to do this is?
I guess they've officially given the go-ahead, so here's a Leopard-
only solution to make things look right. Getting the selection and
drag behavior right is left as an exercise for the reader.
Implement the following delegate methods for NSOutlineView with the
source list style turned on. Assuming, of course, that you're using a
subclass of NSTextFieldCell for display. Return a regular NSString as
the object value for the table column.
- (BOOL)outlineView:(NSOutlineView *)sender isGroupItem:(id)item {
if (ITEM IS HEADING)
return YES;
else
return NO;
}