• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Handling mouse click event on a NSButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling mouse click event on a NSButton


  • Subject: Re: Handling mouse click event on a NSButton
  • From: "I. Savant" <email@hidden>
  • Date: Sun, 2 Mar 2008 19:40:33 -0500

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@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Handling mouse click event on a NSButton
      • From: "Felipe Monteiro de Carvalho" <email@hidden>
References: 
 >Handling mouse click event on a NSButton (From: "Felipe Monteiro de Carvalho" <email@hidden>)

  • Prev by Date: Re: Core Data opens files as empty
  • Next by Date: Re: Problems with ScriptingBridge and iTunes
  • Previous by thread: Handling mouse click event on a NSButton
  • Next by thread: Re: Handling mouse click event on a NSButton
  • Index(es):
    • Date
    • Thread