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: George Orthwein <email@hidden>
- Date: Thu, 14 Jun 2007 21:27:50 -0400
Thanks very much for replying and letting me know what I was seeing
was unusual. I double checked everything again and finally created a
brand new test project where I finally did see different behavior.
And then I figured out the problem....
In IB's attributes pane, there's these little radio buttons to "Send
Action on:" "Enter only" or "End editing".
Doh!! I feel pretty stupid.
In my *slim* defense, where the heck are these mentioned in the
documentation? I looked through the class references and guides for
way too many hours today trying to figure out what was wrong. Even
searching the dev site now for "Enter only" or "send action on" gives
no results. (Ok, finally found it... NSCell's
sendsActionOnEndEditing: I should have checked the superclasses more
carefully. *sob*)
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
Yep, the column actually doesn't even allow an action. Had to click
the little triangle to assign it to the NSTextFieldCell.
I'm still finding that the the "Enter only" and "End editing" have no
effect on an NSTextFieldCell in a Table. This makes some sense since
the entire Table is the Control. The actions for the Table are sent
by clicking on certain cells. I guess there is no reason why the
TextFieldCell should instead send an action for editing instead.
(Although those options should probably be dimmed in IB.)
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.
This helps as well. I guess I had seen one too many examples of
overriding textDidEndEditing for other reasons.
Using controlTextDidEndEditing in a delegate is how I can send an
action after editing the text cell in a table.
Phew!
George
_______________________________________________
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