Re: Source list group item indentation
Re: Source list group item indentation
- Subject: Re: Source list group item indentation
- From: Corbin Dunn <email@hidden>
- Date: Wed, 16 Jan 2008 11:49:10 -0800
Subclass NSOutlineView, and override the following method:
- (NSRect)frameOfOutlineCellAtRow:(NSInteger)row
{
// Default to show triangle
BOOL showTriangle = YES;
// See if delegate responds to new selector
if ([[self delegate]
respondsToSelector
:@selector(outlineView:shouldShowDisclosureTriangleForItem:)])
{
Ah! One thing that I highly recommend changing is the selector
signature. Let's say you call your class "CDOutlineView". I'd suggest
using the selector name:
cdOutlineView:shouldShowDisclosureTriangleForItem:.
If Apple introduces the same method name in a later version of the OS
then it may conflict with yours, and it may start to be called at
different times with different parameters. This type of thing does
happen, and I'll give you an example. On Leopard we introduced:
- (NSCell *)tableView:(NSTableView *)tableView dataCellForTableColumn:
(NSTableColumn *)tableColumn row:(NSInteger)row;
However, other people implemented the same thing in a custom subclass,
and it caused compatibility problems. The solution was for people to
be forced to link against Leopard in order to use the new delegate
method, which is unfortunate (mainly because it doesn't allow people
to sort of soft-adopt it in their 10.4 apps - if that doesn't make
sense, don't worry).
corbin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden