Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Source list group item indentation





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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Source list group item indentation (From: Jonathan Dann <email@hidden>)
 >Re: Source list group item indentation (From: Corbin Dunn <email@hidden>)
 >Re: Source list group item indentation (From: "Kyle Sluder" <email@hidden>)
 >Re: Source list group item indentation (From: Corbin Dunn <email@hidden>)
 >Re: Source list group item indentation (From: Ben <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.