I have a NSButton and I would like to have some code executed when the
button is clicked. Special circunstances for this is that my button is
created purely in code, there are no nib files on the project and also
no use of the Interface Builder, and nor can it be, because I'm
developing a cross-platform library. I haven't found how to do that in
those special circunstances.

  This is covered in the introductory Cocoa material. See:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/chapter_6_section_5.html

The target/action mechanism works the same in code as it does in IB. It's just that in code, you have to explicitly set the target/ action.

--
I.S.


_______________________________________________

Cocoa-dev mailing list ([email protected])

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