Re: drawingRectForBounds not being called
Re: drawingRectForBounds not being called
- Subject: Re: drawingRectForBounds not being called
- From: Tony Romano <email@hidden>
- Date: Fri, 30 Jul 2010 16:05:23 -0700
@interface ViewStatusTextCell : NSTextFieldCell
- (NSRect)drawingRectForBounds:(NSRect)theRect;
@end
- (NSRect)drawingRectForBounds:(NSRect)theRect
{
NSRect rect = [super drawingRectForBounds:theRect];
NSSize textSize = [self cellSizeForBounds:theRect];
NSUInteger heightDelta = rect.size.height - textSize.height;
if (heightDelta > 0) {
rect.size.height -= heightDelta;
rect.origin.y += heightDelta/2;
}
return rect;
}
On Jul 30, 2010, at 4:03 PM, Kyle Sluder wrote:
> On Fri, Jul 30, 2010 at 3:38 PM, Tony Romano <email@hidden> wrote:
>> I have an NSTextTextField in my nib that is using a custom NSTextFieldCell (set in IB) class that has only one method over-riden, drawingRectForBounds. The method is not being called. This is what I have done.
>>
>> 1. Set a break point to verify it is not being called.
>> 2. Using F-Script, verified that the instance of NSTextField is using my custom cell. I can invoke my method via F-Script as well.
>> 3. Verified the correct spelling and signature of the method.
>
> Are you certain? The method is named -drawingRectForBounds:. Since you
> omitted the colon above, I am wondering if you have in fact misspelled
> the method.
>
> Please post your code.
>
> --Kyle Sluder
>
-Tony
_______________________________________________
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