What am i trying to do
I am trying to add editing functionality in place in the NSKrowser Connection Kit. I would like this behavior to be functionally and visually similar to the Finder implementation.
The visual effect I'm aiming for

What am i still

The arrows indicate the focus ring and cell selection in the Finder implementation, as well as its absence in mine.
I tried
- Setting the background color of the cell in the controller, in it
drawInteriorWithFrame method - The same for the field editor
setFocusRingType:NSFocusRingTypeDefault for the field and cell editor in both the controller and the drawing method- Manually draw highlight color in paint method
- Various combinations of the above and, undoubtedly, some of them I forgot.
The best I have been able to do is get the area surrounding the cell image painted in the highlight color.
Are there any fundamental points that I miss here? Can anyone suggest a starting point for this? Is drawInteriorWithFrame place for this?
I have some editing work - I just have problems with the visual aspects.
Code for editing:
And in my subclass of NSBrowserCell:
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { image = [[self representedObject] iconWithSize:[self imageSize]]; [self setImage:image]; NSRect imageFrame, highlightRect, textFrame;
source share