• 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: End Editing with RETURN
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: End Editing with RETURN


  • Subject: Re: End Editing with RETURN
  • From: Lorenzo <email@hidden>
  • Date: Sat, 07 Jun 2003 20:44:16 +0200

Thank you Greg,
I subclassed the NSTextField class to MYTextField class,
then I implemented the delegate methods

textDidBeginEditing and textDidEndEditing

now, please how can I grab the NSText field editor from the information on
that notification, register and then reuse that later in the
textDidEndEditing notification?

I never used the NSText field editor and I have few experience on
notifications.

Also, do you think I can let the user write returns inside a NSTextField
field instead of closing the editing of the field itself?


Best Regards
--
Lorenzo
email: email@hidden


> On Thursday, June 5, 2003, at 05:43 PM, Bill Cheeseman wrote:
>
>> So, you're saying that the text field gets information from the
>> notification
>> it observes from the field editor, which enables the text field to
>> distinguish among the various keys the user might have pressed to end
>> editing. But that information does not get passed along to me, the
>> user/developer, because all I can observe is the
>> -controlTextDidEndEditing:
>> notification from the text field, which only gives me a userInfo
>> dictionary
>> with an NSFieldEditor key. Which is what I thought in the first place.
>>
>> The NSTextMovement userInfo information can only be obtained by
>> subclassing
>> NSTextField. Did I get that right? If so, I simply misunderstood the
>> context
>> of your initial message, which was about subclassing NSTextField.
>
> Exactly. You are right about everything else... if you are simply
> observing NSTextField instead of subclassing then the
> -controlTextDidEndEditing: notification isn't enough.
>
> If you are a user of an NSTextField though, you can distinguish tabs
> from returns by watching the NSTextField for
> -controlTextDidBeginEditing:, grab the NSText field editor from the
> information on that notification, and register yourself for the NSText
> -textDidEndEditing:, so you will receive the notification directly in
> addition to what the field itself does.
>
> Hope this helps,
> - Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Change User ID
  • Next by Date: Re: Change User ID
  • Previous by thread: Re: End Editing with RETURN
  • Next by thread: OT: Where's flockfile
  • Index(es):
    • Date
    • Thread