Re: Clarifying when NSTextField/Cell triggers target/action...
Re: Clarifying when NSTextField/Cell triggers target/action...
- Subject: Re: Clarifying when NSTextField/Cell triggers target/action...
- From: Keary Suska <email@hidden>
- Date: Thu, 14 Jun 2007 14:25:27 -0600
- Thread-topic: Clarifying when NSTextField/Cell triggers target/action...
on 6/14/07 1:22 PM, email@hidden purportedly said:
> I'm sort of surprised by the behavior I'm seeing so I just want to
> verify that it is correct...
>
> NSTextFields:
> I'm only seeing them trigger the action when pressing Return or
> Enter. Editing and hitting tab allows a new value without triggering
> the action.
This is surprising, as it is not the correct behavior, and I can't duplicate
it. For me, the NSTextField's action method is called every time I edit the
field and hit the tab key. It is not triggered, however, if the field has
been edited.
> However, the NSTextField reference listing for textDidEndEditing does
> seem to say action is only sent with Return (and we assume Enter as
> well?):
There is confusion here. The NSTExtField does *not* handle editing. Editing
is handled by the field editor, an NSTextView instance that every window
maintains. If you want to know how editing is handled, you should look up
the field editor.
> NSTextFieldCells in a tableview:
> It appears that clicking on the cell will trigger the action, while
> editing and updating the value does not. So you can tab in, change
> the value and tab/return/enter out and not trigger the action.
How are you assigning the action to the cell? Are you sure that you aren't
just assigning the action to the NSTableColumn? A table column
> I would like to trigger the action whenever an edit happens. I assume
> I need to use textDidEndEditing and trigger the action (and perhaps
> nicely filter out NSCancelTextMovement)?
Look at the NSControl text delegate methods. You will have finer grained
control over an action, and reading the method descriptions may answer some
of your questions better.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden