Re: Merging scrolling/clipping with NSStackView
Re: Merging scrolling/clipping with NSStackView
- Subject: Re: Merging scrolling/clipping with NSStackView
- From: Jonathan Mitchell <email@hidden>
- Date: Fri, 20 Jan 2017 21:44:57 +0000
> On 20 Jan 2017, at 21:36, Quincey Morris <email@hidden> wrote:
>
> On Jan 20, 2017, at 02:47 , Jonathan Mitchell <email@hidden <mailto:email@hidden>> wrote:
>>
>> NSTableView might go something like this:
>>
>> @implementation TSTableView
>>
>> - (NSSize)intrinsicContentSize
>> {
>> NSSize size = [super intrinsicContentSize];
>> NSInteger nr = [self numberOfRows];
>> CGFloat rh = [self rowHeight];
>> CGFloat ih = [self intercellSpacing].height;
>> size.height = rh * nr + ih * MAX(nr, 1);
>> return size;
>> }
>
> My concern about this approach is timing. It needs to be supported by other code that triggers autolayout whenever the number of rows changes. Further, if the row height is not fixed (either because the height varies from row to row, or because the row height is a logical height influenced by the system-wide font size settings), it gets even more complicated.
Absolutely. Getting from raw concept to actual implementation for a particular use case can be a painful process.
And sometimes it is just not worth the candle.
I wince at the thought of the number of hours I have spent wrangling with auto layout.
_______________________________________________
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