• 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: Distinguish Pending Text from Committed Text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Distinguish Pending Text from Committed Text


  • Subject: Re: Distinguish Pending Text from Committed Text
  • From: Michael Ash <email@hidden>
  • Date: Tue, 19 May 2009 12:13:50 -0400

On Tue, May 19, 2009 at 9:48 AM, Dong Feng <email@hidden> wrote:
> When using an non-English input method, such as Japanese or Chinese,
> the entered characters are first in a pending status (i.e. with an
> underscore). Pressing the space key make those pending text converted
> to the actual non-English characters. Pressing the Enter key make the
> underscore beneath the letters disappear. Either way, the pending text
> become committed.
>
> I want to programmatically distinguish the committed text from the
> pending one, in a NSTextField. [NSTextField stringValue] returns the
> sum, not only the committed part. Is there any way to do so?

Check out the NSTextInput protocol. NSTextView conforms to that
protocol, so if you get the field editor from your NSTextField, you
can use those methods. I believe that "marked" is what that protocol
calls what you are referring to as "pending", but I'm not 100% sure.

(Warning: I've never tried any of this.)

Mike
_______________________________________________

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

  • Follow-Ups:
    • Re: Distinguish Pending Text from Committed Text
      • From: Dong Feng <email@hidden>
    • Re: Distinguish Pending Text from Committed Text
      • From: Gideon King <email@hidden>
References: 
 >Distinguish Pending Text from Committed Text (From: Dong Feng <email@hidden>)

  • Prev by Date: Re: [ANN] KNAppGuide - an open source in-app tutorial framework
  • Next by Date: When init returns nil does it cause a leak
  • Previous by thread: Distinguish Pending Text from Committed Text
  • Next by thread: Re: Distinguish Pending Text from Committed Text
  • Index(es):
    • Date
    • Thread