Bug in Apple's ImageAndTextCell ?
Bug in Apple's ImageAndTextCell ?
- Subject: Bug in Apple's ImageAndTextCell ?
- From: Bertrand Mansion <email@hidden>
- Date: Sun, 11 Apr 2004 18:15:03 +0200
Hi,
ImageAndTextCell was giving me strange results when the cell image was set
to nil. When cells were edited, the select frame was not drawn where it
should, creating a big empty space on its left. So I changed :
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart
length:(int)selLength {
NSRect textFrame, imageFrame;
NSDivideRect (aRect, &imageFrame, &textFrame, 3 + [image size].width,
NSMinXEdge);
[super selectWithFrame: textFrame inView: controlView editor:textObj
delegate:anObject start:selStart length:selLength];
}
to:
- (void)selectWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject start:(int)selStart
length:(int)selLength {
NSRect textFrame;
if (image != nil) {
NSRect imageFrame;
NSDivideRect (aRect, &imageFrame, &textFrame, 3 + [image
size].width, NSMinXEdge);
} else {
textFrame = aRect;
}
[super selectWithFrame:textFrame inView:controlView editor:textObj
delegate:anObject start:selStart length:selLength];
}
Please let me know if I shouldn't be doing this :)
HTH
Bertrand Mansion
Mamasam
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.