0

I am creating an OutlineView like this:

My OutlineView

And I want to achieve a view which looks like this:

Desired view

The 2 issues that I am facing are:

  1. I cant find a way to move the disclosure triangle between the folder icon and the name.

  2. I am unable to setup the "P" icon for the child nodes.

For the 2nd issue, this is the code I tried setting up the icon with:

- (void)outlineView:(NSOutlineView *)aTableView willDisplayCell:(NSCell*)aCell forTableColumn:(NSTableColumn *)aTableColumn item:(id)item
{
    NSImage* image = nil;
    BOOL isLeaf = [item isLeaf];
    
    if ([[aTableColumn identifier] isEqualToString:@"styleIcon"]) {
        
        if (aTableView == _charOutlineView) {
             image = [QXPGeneralInterfaces imageFor:(isLeaf ? kCharacterIconImage : kFolderIconImage)];
        }
        else {
            image = [QXPGeneralInterfaces imageFor:(isLeaf ? kParagraphIconImage : kFolderIconImage)];
        }
        
        if (image != nil) {
            [aCell setImage:image];
        }
}

aCell does set the image but somehow it disappears in the UI.

HangarRash
  • 7,314
  • 5
  • 5
  • 32
  • Ask one question per question please. Please read [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask). – Willeke Aug 22 '23 at 14:10

1 Answers1

0

I cant find a way to move the disclosure triangle between the folder icon and the name.

Put the folder icon in column 0 and the title in column 1. Set outlineTableColumn (or the Outline Column in IB) to column 1.

Willeke
  • 14,578
  • 4
  • 19
  • 47