objective c - NSOutlineView: how to make parent items bold? -


I have an NSOutlineView with a list of parents and list of children.

What is the easiest way to create parental things (people with opening arrows) in bold text?

Thanks

If you are using a cell-based outline view, You can use this representative method for bold parent items:

  // Suppose you see NSTextFieldCell - (Zero) outline: (NSOutlineView *) outlineView willDisplayCell: (ID) Cell forTableColumn: (NSTableColumn *) tableColumn item: (id) item {if ([self outlineView: outlineView numberOfChildrenOfItem: items]> 0) {[(NSCell *) cell setFont: [NSFont boldSystemFontOfSize: (NSCell *) cell ). Font point size]]; } Other {[(NSCEL *) cell set font: [NSFTIN SystemFontAffice: ((NSCell *) cell). Fontpointsis]]; Otherwise, in a visual-based profile view, you can:  
  - (NSView *) Outline view: (NSOutlineView *) Outline view viewForTableColumn: (NSTableColumn *) tableColumn item: (id) item {NSTableCellView * cellView = [outlineView makeViewWithIdentifier: @ "MyIdentifier" owner: self]; If ([self outlineView: outlineView numberOfChildrenOfItem: items]> gt; {[cellView.textField setFont: [NSFont boldSystemFontOfSize: cellView.textField.font.pointSize]]; } And {{Selveau.TextField SetFont: [NSFont systemFontOfSize: cellView.textField.font.pointSize]]; } // Do whatever you return to the cellview; }  

Alternatively, for NSOutlineViewDelegate -outlineView: isGroupItem: You may be looking for: :


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -