• 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: "Hamish Allan" <email@hidden>
  • Date: Wed, 16 Jan 2008 19:52:58 +0000

NB to avoid compiler warnings, you can create a category on NSObject:

@interface NSObject (DisclosureTriangleAdditions)

- (BOOL)outlineView:(NSOutlineView *) shouldShowDisclosureTriangleForItem:(id);

@end

Then your method becomes:

- (NSRect)frameOfOutlineCellAtRow:(NSInteger)row
{
    // Default to show triangle
    BOOL showTriangle = YES;

    if ([[self delegate] respondsToSelector:
        @selector(outlineView:shouldShowDisclosureTriangleForItem:)])
    {
        showTriangle = [[self delegate] outlineView:self
            shouldShowDisclosureTriangleForItem:item];
    }

    if (!showTriangle)
    {
        // If not showing triangle, return empty rect
        return NSZeroRect;
    }
    else
    {
        // else return default value
        return [super frameOfOutlineCellAtRow:row];
    }
}

> Then, replace your outline views in IB with your custom one, and the
> delegate can implement:
>
> - (void)outlineView:(NSOutlineView *)
> shouldShowDisclosureTriangleForItem:(id)item

Don't forget to declare this with a non-void return type :)

Hamish
_______________________________________________

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: Source list group item indentation
  • Next by Date: Re: Quitting Current Application
  • Previous by thread: Re: Source list group item indentation
  • Next by thread: Re: Source list group item indentation
  • Index(es):
    • Date
    • Thread