• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Merging scrolling/clipping with NSStackView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Merging scrolling/clipping with NSStackView


  • Subject: Re: Merging scrolling/clipping with NSStackView
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 20 Jan 2017 13:36:47 -0800
  • Feedback-id: 167118m:167118agrif8a:167118shXaxtdZ-e:SMTPCORP

On Jan 20, 2017, at 02:47 , Jonathan Mitchell <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.

The text field is less problematic, if for no other reason that a NSTextField has the desired behavior and it’s backed by a NSTextView. If the UI could have a text field instead of a text view there’d be no problem.

_______________________________________________

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


  • Follow-Ups:
    • Re: Merging scrolling/clipping with NSStackView
      • From: Jonathan Mitchell <email@hidden>
References: 
 >Merging scrolling/clipping with NSStackView (From: Daryle Walker <email@hidden>)
 >Re: Merging scrolling/clipping with NSStackView (From: Quincey Morris <email@hidden>)
 >Re: Merging scrolling/clipping with NSStackView (From: Jonathan Mitchell <email@hidden>)

  • Prev by Date: Re: Merging scrolling/clipping with NSStackView
  • Next by Date: Re: Merging scrolling/clipping with NSStackView
  • Previous by thread: Re: Merging scrolling/clipping with NSStackView
  • Next by thread: Re: Merging scrolling/clipping with NSStackView
  • Index(es):
    • Date
    • Thread