Re: Can NSView and NSImageView respond to Mouse Clicks?


Andy Lee
 

On Sep 19, 2018, at 2:34 PM, Dave <dave@...> wrote:
Can the same be done with NSImageView? I’ve added an image view and connected it to an IBAction method define in my View Controller, but when I click the NSImageView nothing happens…..
From the docs:

<https://developer.apple.com/documentation/appkit/nsimageview?language=objc>
Note
An image view calls its action method only when the user drags an image into the image view's bounds, and the image view must be editable to receive dragged images. If you want to display an image and respond to clicks in the image, use an NSButton object instead.
--Andy

Join cocoa@apple-dev.groups.io to automatically receive all group messages.