• 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: Overriding NSCell's editWithFrame:...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding NSCell's editWithFrame:...


  • Subject: Re: Overriding NSCell's editWithFrame:...
  • From: Mike Abdullah <email@hidden>
  • Date: Tue, 3 Oct 2006 18:56:04 +0100

I have to agree with you, Apple's docs aren;t too amazing on this topic. I shall (attempt!) to explain:

Basically, when you edit some text, you use an NSTextView. However, imagine you have 50 or so NSTextViews in your app, it will get bogged down quite a bit!

So instead, we have NSTextField which is more "lightweight."

Additionally, every window has a Field Editor which is a single instance of NSTextView.

When an NSTextFieldCell (or similar class) wants to edit some text, it gets the field editor from the window and positions it above itself. The user types into this NSTextView, and it is this which provides the focus ring above the control.

So, in your method, you basically need to get the field editor from the window and make it a subview of your controlview.

Mike.

On 3 Oct 2006, at 17:53, David Aames wrote:

Hello Mike,

I did and it included just general information and nothing specific on implementing editWithFrame: from scratch.

Thanks

On 3 Oct 2006, at 11:53, Mike Abdullah wrote:

I think you need to read up on the window's fieldEditor.

Mike.

On 3 Oct 2006, at 02:26, David Aames wrote:

Hello all,

I'm writing my own NSCell and I want to be able to edit my cell so I would like to learn the proper way of implementing this method (editWithFrame:inView:editor:delegate:event:). I cannot really understand what this method is supposed to do. I'm deliberately not subclassing NSTextFieldCell to use it's implementation of this method. So what am I supposed to do in this method? I can get the text for this cell and also modify the rectangle to match my text but how do I display the editing rectangle and everything else? Has anyone actually overridden this method without using the super implementation?

Thanks,
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Overriding NSCell's editWithFrame:... (From: David Aames <email@hidden>)
 >Re: Overriding NSCell's editWithFrame:... (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: When do I have to update the typing attributes?
  • Next by Date: Re: Re: NSTabView and interface drawing artifacts
  • Previous by thread: Re: Overriding NSCell's editWithFrame:...
  • Next by thread: Re: Overriding NSCell's editWithFrame:...
  • Index(es):
    • Date
    • Thread