• 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
Different NSCells in an NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Different NSCells in an NSOutlineView


  • Subject: Different NSCells in an NSOutlineView
  • From: malcom <email@hidden>
  • Date: Thu, 20 Oct 2005 00:50:21 +0200

Hi,
I have created an NSOutlineView class with a custom cell class attached.
I've used this instructions to provide a custom class:

    myCell = [[[myCustomCellClass alloc] init] autorelease];
    [myCell setEditable: YES];
    [[myOutlineView outlineTableColumn] setDataCell: myCell];

All works fine but now I would to use two different kind of NSCell
inside my OutlineView. Is this possible? And how? (anyone can provide
a short example or link to a project example).

I have another question. To make my custom NSCell class I've used the
instructions in ImageAndTextCell of DragNDropOutlineView of ADC
Examples. I have added a new line
with this instruction inside - (void)drawWithFrame:(NSRect)cellFrame
inView:(NSView *)controlView:

   [@"my subtitle text" drawInRect:NSMakeRect(38,14,50,40) withAttributes:
			[NSDictionary dictionaryWithObjectsAndKeys: [NSFont
fontWithName:@"Lucida Grande" size:9],
			NSFontAttributeName,
			[NSColor grayColor],
			NSForegroundColorAttributeName,
			nil, nil]];

Unfortunatly when I select the row the 'subtitle' text does not appear
anymore. Why?
(main text will be returned by a return @STRING into -
(id)outlineView:(NSOutlineView *)outlineView
objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
 of my NSOutlineView).

Thank you very much.
Malcolm
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Different NSCells in an NSOutlineView
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: NSAutoreleasePool dilemma
  • Next by Date: Re: NSAutoreleasePool dilemma
  • Previous by thread: Re: [NSMutableDictionary setObject:forKey:] problem
  • Next by thread: Re: Different NSCells in an NSOutlineView
  • Index(es):
    • Date
    • Thread