Re: NSText sizeToFit doesn't
Re: NSText sizeToFit doesn't
- Subject: Re: NSText sizeToFit doesn't
- From: Wade Tregaskis <email@hidden>
- Date: Sun, 11 Jan 2004 22:20:00 +1100
I can't see a [labelFont set] in your code so that labelView kows what
font to use for it's size calculations. (I'm guessing that it is
calculating the size based upon a non-bold font variant and you are
then setting the font to bold (larger) just before you draw...)
No, I do set the font, right before setting the string.
labelView = [[[NSText alloc] initWithFrame:NSMakeRect(0,
currentPosition, 150, space)] autorelease];
[labelView setFont:labelFont];
[labelView setString:label];
I had a similar thought. But mine was more along the lines of
sizeToFit using only the Regular style, rather than applying
Bold/Italic/etc appropriately.
Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.