Horizontally scrolling NSTextView in IB
Horizontally scrolling NSTextView in IB
- Subject: Horizontally scrolling NSTextView in IB
- From: Camillo Lugaresi <email@hidden>
- Date: Thu, 5 Jan 2006 21:58:04 +0100
Hello,
I need an NSTextView that doesn't wrap lines, but instead displays a
scrollbar if a line goes beyond the frame. I couldn't find a way to
set it up like that in Interface Builder. Am I missing something?
I can still add a horizontal scrollbar programmatically, as explained
here: <http://developer.apple.com/documentation/Cocoa/Conceptual/
TextUILayer/Tasks/TextInScrollView.html#//apple_ref/doc/uid/20000938>
However, I encountered a weird bug with that approach: the scroller
would only grow horizontally to a certain (small) limit, after which
I could continue typing on a single line, but I couldn't scroll far
enough to see its end. This was fixed when I changed the width of the
NSTextView's layout rectangle to a very big value, then turned it
back to match the width of the NSScrollView. Even though all visible
properties in IB were the same as before, the bug was now gone and
the scroller could grow freely. What happened?
A wild guess is that my maneuver might have increased the
NSTextView's maxSize, but why isn't that visible anywhere in IB?
In general, I find IB's interface for working with scroll views
somewhat confusing. There is the frame rectangle of the NSScrollView,
its layout rectangle, the frame rectangle of the enclosed NSTextView,
and its layout rectangle. What exactly is the relationship between
these four rectangles?
Camillo
_______________________________________________
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