Skip navigation.
 
mlRe: Handling mouse click event on a NSButton
FROM : I. Savant
DATE : Mon Mar 03 01:40:33 2008

> 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.

Related mailsAuthorDate
mlHandling mouse click event on a NSButton Felipe Monteiro de… Mar 3, 01:25
mlRe: Handling mouse click event on a NSButton I. Savant Mar 3, 01:40
mlRe: Handling mouse click event on a NSButton Felipe Monteiro de… Mar 3, 02:58
mlRe: Handling mouse click event on a NSButton I. Savant Mar 3, 03:04
mlRe: Handling mouse click event on a NSButton I.Savant Mar 3, 03:10