On 24 Jul 2008, at 3:58 pm, Oleg Krupnov wrote:

target/action

Is this the same as the following?

action is sent to target on a click. The other things you mention are either
not detected or not sent on to the target.

I don't quite understand how target/action works under the hood. If I
were an implementor of NSButton, how would I declare that namely the
"click" event should trigger the actions in the Sent Actions list?
Currently the "Sent Actions" section does not even appear in my custom
view's connections menu at all, how would I make it appear?


Yes, it's the same, though usually target/action is used with standard controls and probably wouldn't be used for general signalling from a custom view unless you are doing something very control-like (in which case you could inherit from NSControl and get this support for free).

programmatically, you use -setTarget: and -setAction:

in IB, you ctrl-drag from the button to the target, and pick the action from the popup menu. This can then be reviewed in the "sent actions" section of the button's attributes under the "connections" tab.


Graham
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to