• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView question


  • Subject: Re: NSTextView question
  • From: Ricky Sharp <email@hidden>
  • Date: Thu, 16 Mar 2006 14:41:44 -0600

On Thursday, March 16, 2006, at 01:29PM, Matt Neuburg <email@hidden> wrote:

>On Thu, 16 Mar 2006 08:28:32 -0800, Rudi Sherry <email@hidden> said:
>>I have a window with an NSTextView and a button.
>>
>>I type into the NSTextView, then hit the button.  The action of the
>>method gets the value of the text view with [ mTextView
>>stringValue ] ...  but that is the old value, before I started editing.
>>
>>I find I have to hit <return> with focus at the NSTextView in order
>>to have [ mTextView stringValue ] be the edited value.  I don't want
>>to require this behavior.
>>
>>I tried [ mTextView validateEditing ] (from NSControl) but that
>>didn't work either -- [ mTextView stringValue ] was still the old value.
>>
>>How do I get the edited value?
>
>I remember once hearing about a lecture where at the end the speaker said:
>"Oh, I'm terribly sorry, everywhere I said Alcibiades, I meant St Paul." Is
>it like that with this note? Everywhere you say NSTextView, do you mean
>NSTextField?
>
>If so, try setting the window's first responder to nil first thing in the
>button's action method. m.

It may also be possible to set the first responder to the field/view.  That may be enough to end editing.  Also, the keyboard focus will not be "stolen".

If it really takes setting the first responder to nil, you may want to consider getting the next responder.  And, if that next responder isn't the view, set it.  This will keep users of full-keyboard access happy.

--
Rick Sharp
Instant Interactive(tm)

 _______________________________________________
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

  • Follow-Ups:
    • Re: NSTextView question
      • From: Rudi Sherry <email@hidden>
References: 
 >Re: NSTextView question (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Res Independence [Was: Accessing window back buffer without deprecated functions in Tiger]
  • Next by Date: Re: NSPredicate with CoreData SQL store behavior
  • Previous by thread: Re: NSTextView question
  • Next by thread: Re: NSTextView question
  • Index(es):
    • Date
    • Thread