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: Greg Herlihy <email@hidden>
- Date: Tue, 21 Mar 2006 19:07:01 -0800
- Thread-topic: Tables created in code have different row height from those created in IB
The size of the default font for a table (more precisely, the font size of
of NSTableColumn's default cell) changed between Panther and Tiger. For apps
linking against Panther or earlier the default font is Lucida Grande 12, for
Tiger-linked apps the default font is Lucida Grande 13. The default height
for the former is 16 and for the latter, 17.
This change may help explain the apparent discrepancy.
Greg
On 3/21/06 10:42 AM, "Peter Boctor" <email@hidden> 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
>
> On 3/20/06, Greg Herlihy <email@hidden> wrote:
>>
>> Yes, there are actually two such methods - but one is deprecated.
>>
>> I would look at NSFont's defaultLineHeightForFont: (deprecated) and
>> NSLayoutManager's defaultLineHeightForFont: (its recommended replacement -
>> that cleverly re-uses the same name).
>>
>> On 3/20/06 1:29 PM, "Peter Boctor" <email@hidden> wrote:
>>
>>> If I drag out a table in IB, the default row height is 17. Creating a
>>> table in code [[NSTableView alloc] init] returns a table with a row
>>> height of 16 which not surprisingly looks squished. Why aren't the
>>> default values the same?
>>>
>>> More importantedly how do I work around this? I'd like the tabe to
>>> look correct if a future OS version changes the row height so I'd like
>>> to avoid a hardcoded call setting the row height to 17. Is there
>>> another call that will give me the proper row height?
>>>
>>> -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