Re: How do you set the text in an NSTextView?
Re: How do you set the text in an NSTextView?
- Subject: Re: How do you set the text in an NSTextView?
- From: Mark <email@hidden>
- Date: Mon, 10 May 2010 10:15:33 +0100
On 10 May 2010, at 00:50:41, G S wrote:
You need to Control-drag to a region in the NSTextView that
conceptually represents a first line of text (somewhere near the
top) if it's empty, or to the visible text if it's not, to select
the textView instead of the scrollView.
Yep, that's it! Thanks. Talk about OBSCURE.
It could be considered obscure. Some people will find it, some won't
I guess. I think I found it by just moving the mouse around (it's a
general trick to learn in IB because embedded objects often have
certain hit targets for drag-connecting to those particular parts. It
can seem like a crazy mess until you figure this out).
Repeatedly clicking on it does drill down (there's only two
classes), but again you need to click on the text region or the 'top
line' if there's no text visible. If you Control-Shift-click it you
can see and select from the window's view hierarchy.
Not even Control-Shift-click will allow access to the real
textView. The bottom level in the pop-up list is, once again, the
ScrollView.
You're clicking off the 'textView region' again and just hitting the
content view of the scrollView (because the textView doesn't extend
the full height of the scrollView's content view unless it has enough
content to actually do so). Try the Control-Shift-click up at the top
and you'll see the full hierarchy. Also try it in one of the
scrollers, if they're visible, and you'll see an NSScroller instance
(e.g. "Vertical Scroller"). It all makes sense if you think about how
it's constructed.
The textView is a more obvious target if it contains some visible text
in IB, but when empty it becomes rather small by definition, but it's
not actually shrunk to zero height though, there's always a single
line there to hold the caret and to give you something to click on.
_______________________________________________
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