Customize the disclosure triangles in NSOutlineView

  • Hi All,

    I'm trying to simulate the Source List views that appear in
    iTunes/iPhoto/etc. In one of my applications and I've noticed that the size
    of the outline disclosure triangles is smaller than the ones provided by
    NSOutlineView.  How does one change the appearance of the disclosure
    triangles?  These don't appear to be drawn by the dataCell.

    Thanks
    -Mark

    ------------------------------------------------------------------------
    Mark Alldritt                      Late Night Software Ltd.
    Phone: 250-380-1725                Script Debugger 4.0 - AppleScript IDE
    WEB:  http://www.latenightsw.com/  FaceSpan 4.3 - AppleScript RAD
                                      Affrus 1.0 - Perl Debugging
  • On Sep 8, 2007, at 12:54, Mark Alldritt wrote:

    > Hi All,
    >
    > I'm trying to simulate the Source List views that appear in
    > iTunes/iPhoto/etc. In one of my applications and I've noticed that
    > the size
    > of the outline disclosure triangles is smaller than the ones
    > provided by
    > NSOutlineView.  How does one change the appearance of the disclosure
    > triangles?  These don't appear to be drawn by the dataCell.

    I did this a while ago by implementing the delegate method

    - (void)outlineView:(NSOutlineView *)ov willDisplayOutlineCell:
    (id)cell forTableColumn:(NSTableColumn *)tc item:(id)item;
    {
    NSButtonCell *outlineCell = cell;
    //
    // create static NSImage instances for the cell
    //
    [outlineCell setImage:rightImage];
    [outlineCell setAlternateImage:downImage];
    }

    If you find a better way, I'd be curious to know.  I was trying to
    implement an outline view similar to the one used by Spotlight on 10.4
    (I can send a link to the source if you want...BSD license).

    hth,
    Adam
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today