• 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
Bug in Apple's ImageAndTextCell ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Passing C Style Function Callbacks in Cocoa
  • Next by Date: Re: NSBrowser headache
  • Previous by thread: Sorting a NSOutlineView
  • Next by thread: Re: XCode ObjC preprocessing plug in?
  • Index(es):
    • Date
    • Thread