Re: Table of TextViews
Re: Table of TextViews
- Subject: Re: Table of TextViews
- From: Keary Suska <email@hidden>
- Date: Thu, 09 Oct 2014 08:19:24 -0600
On Oct 9, 2014, at 7:40 AM, Charles Jenkins <email@hidden> wrote:
> Thank you, Ken. Originally I started out by implementing the table view using a data source and delegate. With some help from list members, I got that working pretty well except for row height. I only started my latest test app using NSArrayController and bindings because I mistakenly thought the Row Height binding would be useful.
>
> Here’s the problem I have: I can set up my text container and text view to pin their widths to the enclosing scroll view, no problem. And I can set the text container to size itself vertically to fit the text, and I can set my text view to size itself vertically to fit the text container. All that has worked for me in a demo app. The only piece missing is to get the text view to call the table view’s noteHeightOfRowsWithIndexesChanged:
>
> I create the text views programmatically instead of using IB, because apparently the only way to get ‘em in IB is enclosed in individual scroll views I don’t need. So how can I get my individual, programmatically created text views to react by notifying the table view when they update their size?
You generally wouldn't, as they are both views. You could have a custom subclass of NSTableView or you would have a controller--preferably the table view delegate as it knows the most about the table view--send noteHeightOfRowsWithIndexesChanged: when it is told (possibly by NSTextView delegate method or notification) that the text view size needs to change.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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