Re: When is editWithFrame:... used?

John Musbach <[email protected]> Tue, 6 Dec 2011 19:02:36 -0500
Newsgroups gmane.comp.macosx.devel
Message-ID <CAB2KpuGPH+h_A=mNrtGHxAGYncXCOPi2D+yhcNg_qCJ2L4m+Zw@mail.gmail.com>
On Mon, Dec 5, 2011 at 3:00 PM,  <[email protected]> wrote:
> Message: 1
> Date: Mon, 5 Dec 2011 00:18:35 +0100
> From: Christiaan Hofman <[email protected]>
> Subject: When is editWithFrame:... used?
> To: "[email protected] List" <[email protected]>
> Message-ID: <F256FB34-2237-4E54-820A-E9F9AA20A92C-JAjqph6Yjy+SBuowPCKRtJVzexx5G7lz@public.gmane.org>
> Content-Type: text/plain; =A0 =A0 =A0 charset=3Dus-ascii
>
> Can anyone tell me when NSTextFieldCell's editWithFrame:... method is use=
d? In my testing all ways of editing I have tried always go through selectW=
ithFrame:... and never use editWithFrame:.... I need to know for a subclass=
 whether I need to override this method, but for that I need to test it. Bu=
t when it's not used it's not tested...


editWithFrame:inView:editor:delegate:event:
Begins editing of the receiver=92s text using the specified field editor.

- (void)editWithFrame:(NSRect)aRect inView:(NSView *)controlView
editor:(NSText *)textObj delegate:(id)anObject event:(NSEvent
*)theEvent
Parameters
aRect
The bounding rectangle of the cell.
controlView
The control that manages the cell.
textObj
The field editor to use for editing the cell.
anObject
The object to use as a delegate for the field editor (textObj
parameter). This delegate object receives various NSText delegation
and notification methods during the course of editing the cell's
contents.
theEvent
The NSLeftMouseDown event that initiated the editing behavior.
Discussion
If the receiver isn=92t a text-type NSCell object, no editing is
performed. Otherwise, the field editor (textObj) is sized to aRect and
its superview is set to controlView, so it exactly covers the
receiver. The field editor is then activated and editing begins. It=92s
the responsibility of the delegate to end editing when responding to
textShouldEndEditing:. Upon ending the editing session, the delegate
should remove any data from the field editor.

Availability
Available in Mac OS X v10.0 and later.
See Also
=96 endEditing:
=96 selectWithFrame:inView:editor:delegate:start:length:
Declared In
NSCell.h



--=20
Best Regards,

John Musbach