Re: Tables created in code have different row height from those created in IB
Re: Tables created in code have different row height from those created in IB
- Subject: Re: Tables created in code have different row height from those created in IB
- From: Aki Inoue <email@hidden>
- Date: Tue, 21 Mar 2006 17:04:16 -0800
Hmm, this issue comes back repeatedly recently.
The default line height is affected by the typesetter behavior.
-[NSLayoutManager defaultLineHeightForFont:] would return the correct
value (this case 17) by using
NSTypesetterBehavior_10_2_WithCompatibility.
Aki
IB "presets" an NSTableView up by adding some columns, setting the
row height, and placing it in an NSScrollView. Using the standard
[[NSTableView alloc] init] will not do any of this, and the
programmer must set it up the way they want, including setting the
font. The row height set by IB is not dynamic; once set to 17, it
will stay at 17. NSTableView's initial rowHeight will always be 16;
it won't dynamically change based on system settings; doing so
would be bad for programmers who assume it to be a certain size.
Using defaultLineHeightForFont+1 will make your tableview
dynamically change its size, which is good! But, it isn't something
I want to have NSTableView do by default.
Thanks,
--corbin
On Mar 21, 2006, at 10:42 AM, Peter Boctor wrote:
That looked promising. But unfortunately NSLayoutManager's
defaultLineHeightForFont also returns 16 for the standard system
font.
So instead of hardcoding 17, now I'm hardcoding
defaultLineHeightForFont+1.
I've filed <rdar://problem/4485554>
-peter
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden