I've been trying to implement label editing a la Finder, and found this useful so far:
http://www.cocoadev.com/index.pl?FieldEditorIssues

Essentially, this approach uses the regular NSTextView instance served up by -[NSWindow fieldEditor:forObject], and recomputes the size of that is required for the current text. You can then position the frame of the text view according to taste. This works great up to the point where I limit the size of the text view reaches the maximum size for my "text area" (under the icon, like Finder). What I'd like to have happen then is for the text to scroll like a multiline NSTextField, so that the caret remains in view, but instead the text view remains with its top lines visible, and the caret disappears below along with any typed text, clipped by the frame.

I'm beginning to think that I'm barking up the wrong tree hoping for text scrolling behaviour to appear from NSTextView. I have no enclosing scroll view at the moment (though I suppose I could have a tiny one that has its scrollbar furniture turned off), and I see that NSTextView is a rather different animal to NSTextField (that owns a text field cell that in turn provides -setScrollable, which is what I think I want). However, before I rip the current fieldEditor/ NSTextView stuff apart and try again with creating an NSTextField on demand, I thought I'd seek a few simple answers:

- Is there any way to get NSTextView to have a text scrolling behaviour intrinsically? Perhaps this is really only behaviour produced by an object, like a cell, that wraps the field editor when its hosted there. - If this is a non-starter, is it best to create an NSTextField, or would an NSTextFieldCell work somehow on its own?

-- lwe


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to