Re: NSTextView & Horizontal Scrollbar bug
Re: NSTextView & Horizontal Scrollbar bug
- Subject: Re: NSTextView & Horizontal Scrollbar bug
- From: Eric Gorr <email@hidden>
- Date: Sat, 5 Dec 2009 09:14:51 -0500
On Dec 4, 2009, at 12:30 PM, Ross Carter wrote:
> On Dec 4, 2009, at 9:29 AM, Eric Gorr wrote:
>
>> I've got a sample application at http://ericgorr.net/cocoadev/TextViewNoWrap.zip which demonstrates the problem I am seeing.
>>
>> Basically, there is just a text view on a window with a horizontal scrollbar which appears only when needed.
>>
>> I have set this text view up based on the instructions found in the "Text System User Interface Layer Programming Guide for Cocoa" (page 18 - Setting Up a Horizontal Scroll Bar).
>>
>> After ~77 characters or so, the horizontal scrollbar stops scrolling and I can't make any of the text beyond that visible in my view.
>>
>> This looks like a bug to me and one that is likely already known.
>>
>> Are there any known or suggested workarounds?
>
> In IB you have set the maximum width of the text view to 478, so that is the limit you are running up against.
What is the suggested or common solution?
I noticed, for example, the the height of the text view is set to 1,000,000 pixels and that if I set it to 478 a similar problem occurs.
So, this implies one solution would be to simply set the width of the view to the arbitrarily large value of 1,000,000 pixels as well.
So, the question becomes, why not just set it to FLT_MAX (or should it be CGFloat_Max?) - the same size as the text container?
At this size, the scrollbars continue to work as one would expect. What I don't know is if there would be unexpected side effects or problems using FLT_MAX.
By using FLT_MAX, and the same is likely true of 1,000,000 pixels, there would not seem to be a practical reason to worry about calculating how wide the text view needs to be to be able to scroll to all of the text. I can just set it once and forget about it. Would you agree?
_______________________________________________
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