NSTableView and NSTextFieldCell redraw oddness when undo
NSTableView and NSTextFieldCell redraw oddness when undo
- Subject: NSTableView and NSTextFieldCell redraw oddness when undo
- From: "email@hidden" <email@hidden>
- Date: Fri, 13 Nov 2009 14:35:53 +0000
I have a subclassed NSTextFieldCell to create a cell that draws outside of it's frame.
This is to enable NSTableView rows to have one line of text that runs beneath several other cells.
Bindings are utilised.
This works fine except, curiously, when an operation is undone.
In this case the cell only redraws within its initial cellFrame.
In other words, it doesn't redraw within the extended area as detailed in - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView detailed below.
If I click the table row redrawing occurs correctly.
Tracing shows that the bindings are firing okay and that my code path is the same for do/undo.
All cellFrame rects look as expected.
Is it to be presumed that there is different code path within NSCell following an undo?
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
if (self.twoLine) {
if (self.displayOnSecondLine) {
// draw text for line 2
cellFrame.size.height /= 2;
cellFrame.origin.y += cellFrame.size.height;
// draw to edge of control ?
if (self.extendCell) {
cellFrame.size.width = [controlView frame].size.width - cellFrame.origin.x;
}
} else {
// draw only on first line
cellFrame.size.height /= 2;
}
}
[super drawInteriorWithFrame:cellFrame inView:controlView];
}
Regards
Jonathan Mitchell
Developer
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden