• 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: Knowing how a Text Editing Session ended
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Knowing how a Text Editing Session ended


  • Subject: Re: Knowing how a Text Editing Session ended
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 21 Jul 2010 15:51:43 +0100

Look up the docs on NSTextDidEndEditingNotification. I believe the same user info gets handed out in controlTextDidEndEditing:

On 21 Jul 2010, at 15:30, Motti Shneor wrote:

> Hello Everyone.
>
> I'm implementing a programmatic wrapper for using an NSTextField on our custom view ---
>
> I programmatically create an NSTextField, Embed it in the super-view,  then let the user type in text and as soon as the user finishes, I need to collect the typed string, plus the way the field was dismissed (Esc, Return, Tab, Back-Tab plus modification keys if any). I then release this NSTextField, until I need to create a new one.
>
>
> Now --- I tried to Implement the
>
> - (BOOL)control:(NSControl *)control textShouldEndEditing:(NSText *)fieldEditor;
>
> and the
>
> - (void)controlTextDidEndEditing:(NSNotification *)obj;
>
> NSControl delegate methods , and I even get them called.
>
> However, I don't know how to extract the REASON for the ending of the text editing session. From the input of these delegate, I can extract the FieldEditor responsible, but I don't know how to question it for the reason "I got here".
>
> I could subclass NSTextField and implement the
>
> -insertReturn  and - insertTab methods (of NSResponder) and record the status (Still I don't know how to identify a Back-Tab or an option-Tab or an ctrl-Tab etc) but I try to refrain from subclassing NSTextField.
>
> Any hint will be greatly appreciated!
>
>
>
> Motti Shneor
> ------------------------------------------
> Senior Software Engineer
> Waves Audio ltd.
> [mailto: email@hidden]
>
>
>
>
> _______________________________________________
>
> 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

_______________________________________________

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: Knowing how a Text Editing Session ended
      • From: Motti Shneor <email@hidden>
References: 
 >Knowing how a Text Editing Session ended (From: Motti Shneor <email@hidden>)

  • Prev by Date: Command-line parsing
  • Next by Date: Re: Command-line parsing
  • Previous by thread: Knowing how a Text Editing Session ended
  • Next by thread: Re: Knowing how a Text Editing Session ended
  • Index(es):
    • Date
    • Thread