Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Field editors

Field editors
Thread Tools
seb2
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Jun 11, 2003, 06:57 AM
 
Hi everybody,

so, I got a view that does a lot of custom drawing. Some of the things being drawn are text and I'd like to offer a way to edit that text.

What I'm doing now is to use NSWindow's fieldEditor:forObject: which returns an NSTextView. I can insert that into my view hierarchy, become its delegate, get the textDidEndEditing: notification, then read out the string and work with it.

All that works. But: I did R all TFM I could find, but didn't find an answer to the following question: currently, I do set the frame of the NSTextView to correspond to the text being drawn on my custom view. That works, but neither is it obvious there is a text view (Do I have to draw the keyboard focus ring manually?) nor does it behave the way I want it to as far as scrolling is concerned... When the text gets longer than what fits into the view's rect, the cursor goes into the next line and does _not_ scroll the cursor to be visible as I'd expect it to.

What I'd really want is some equivalent to an NSTextField (that is, a one line editor that always scrolls the cursor to visible). Do I have to assemble that manually or am I just not seeing something obvious?
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:47 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,