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

Knowing how a Text Editing Session ended


  • Subject: Knowing how a Text Editing Session ended
  • From: Motti Shneor <email@hidden>
  • Date: Wed, 21 Jul 2010 10:30:26 -0400
  • Acceptlanguage: en-US
  • Thread-topic: Knowing how a Text Editing Session ended

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

  • Follow-Ups:
    • Re: Knowing how a Text Editing Session ended
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: How to force NSMenu to redraw its menu items?
  • Next by Date: Command-line parsing
  • Previous by thread: Re: How to force NSMenu to redraw its menu items?
  • Next by thread: Re: Knowing how a Text Editing Session ended
  • Index(es):
    • Date
    • Thread