• 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
difficulties with NSCell -setImage method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

difficulties with NSCell -setImage method


  • Subject: difficulties with NSCell -setImage method
  • From: Alex Reynolds <email@hidden>
  • Date: Fri, 7 Dec 2001 03:59:36 -0500

I am attempting to overload the -willDisplayOutlineCell method for outline views, to redraw my custom "expanded/not-expanded" graphics.

It works okay, with the one problem that when the very first item has a child added, it becomes expandible and has a system-default triangle drawn to the outline cell, instead of my custom "non-expanded" or "closed" graphic.

If I click on the expansion triangle, the method below works properly to draw my custom "expanded" or "open" graphic.

If I then close the triangle, the method below draws the "non-expanded" custom graphic properly. Opening and closing nodes works properly from then on.

Is there any way I can fix this so that the custom graphic is drawn the first time around, instead of the system default?

My code for -willDisplayOutlineCell is as follows:

- (BOOL) outlineView: (NSOutlineView *) outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
//
// these are NSButtonCell objects...
//

if ([outlineView isItemExpanded:item])
{
// NSLog (@"Item is expanded");
[cell setAlternateImage:openImage];
[cell setImagePosition:NSImageAbove];
}
else
{
// NSLog (@"Item is closed");
[cell setImage:closedImage];
[outlineView updateCell:cell];
}
return YES;
}

Thanks in advance for any suggestions.

Regards,
Alex


  • Follow-Ups:
    • Re: difficulties with NSCell -setImage method
      • From: Max Horn <email@hidden>
  • Prev by Date: RE: Cocoa Documentation Updated for December Tools Release
  • Next by Date: Re: Drag and drop onto the desktop?
  • Previous by thread: Re: Dot View app compiles but some functions do not work, possibly because of 10.1
  • Next by thread: Re: difficulties with NSCell -setImage method
  • Index(es):
    • Date
    • Thread