Re: Overriding NSCell's editWithFrame:...
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