• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Source list group item indentation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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>)

  • Prev by Date: Re: Handle Dock menu open/close events
  • Next by Date: Re: Source list group item indentation
  • Previous by thread: Re: Source list group item indentation
  • Next by thread: Re: Source list group item indentation
  • Index(es):
    • Date
    • Thread