• 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: NSTextField TAB-Behaviour Overwriting?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextField TAB-Behaviour Overwriting?


  • Subject: Re: NSTextField TAB-Behaviour Overwriting?
  • From: Manfred Lippert <email@hidden>
  • Date: Wed, 19 Jun 2002 11:46:36 +0200

> See "field editor". NSTextField does never do any editing -- an NSTextView
> does it for it (just like for any other text widget).

> A standard tab is by default bound to the selector @selector(insertTab:),
> while option-tab is bound to @selector(insertTabIgnoringFieldEditor:). To
> reverse these, all you need to do is implement the delegate method, look for
> either of these, and if you see one, call the other method on the text view,
> and return YES.

Okay, great, thank you. This seems to work fine for NSTextViews, but for my
NSTextField I now have a lot of other problems ...
But let's start from the beginning, this is what I did:

- I want to overide the TAB behaviour of an NSTextField (not an NSTextView).
- But an NSTextField is using "internally" an NSTextView for its text input.
- So I allocated a custom NSTextView object that I return in
"windowWillReturnFieldEditor:toObject:" in the NSTextFields delegate.
- In the delegate of my new custom NSTextView I override
"textView:doCommandBySelector:" and look for insertTab and
insertTabIgnoringFieldEditor to exchange the behaviour.

OK, so far.

But:

Now the NSTextField behaviour has broken! Normally it sends some
notifications (textDidEndEditing etc.) to its delegate when the user hits
Return, TAB etc. Now it begins a new line when I press Return for example.
Do I have to "mimic" the complete old NSTextField behaviour myself? How
would I do that? Or is there some "flag" somewhere I've missed?
I don't know how I can implement the same behaviour of the NSTextField as it
had before changing its NSTextView to a custom object.

As a first step I tried to call endEditing on the TextField's cell when the
selector "insertNewline:" should be called, but then the entered text will
always disappear ...

Any hints? An easy solution I haven't seen?

Regards,
Mani
_______________________________________________
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.

References: 
 >Re: NSTextField TAB-Behaviour Overwriting? (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: Protecting Software w/ Software License Keys...
  • Next by Date: Extra Menu
  • Previous by thread: Re: NSTextField TAB-Behaviour Overwriting?
  • Next by thread: Guidance on Project Structure
  • Index(es):
    • Date
    • Thread