• 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: Best Control for Catching a Mouse Click?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Control for Catching a Mouse Click?


  • Subject: Re: Best Control for Catching a Mouse Click?
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 07 Dec 2015 11:19:33 -0600

On Mon, Dec 7, 2015, at 10:32 AM, Dave wrote:
> Hi All,
>
> I have a view that is made up for a Text View and a Small Icon like so:
>
> NSView
> 	NSImageView
> 	NSTextField
>
> If the User Clicks anywhere inside the base NSView, I’d like a Perform
> Click IBAction to be sent to the connected class (The View Controller in
> this case). In the past, on iOS i’ve done this by using a transparent
> UIButton that has the same Frame Rect as the base NSView.

This probably made your app inaccessible with VoiceOver. Please do not
use invisible controls for this sort of thing.

> When I tried to
> do with the same with an NSButton, I find that I can’t change the height
> in IB?
>
> On the Mac what is the best control to use to do this?

Use a different approach that will work on both platforms. Override
-hitTest: in a containing view. This will also work well with
accessibility.

--Kyle Sluder

_______________________________________________

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


References: 
 >Best Control for Catching a Mouse Click? (From: Dave <email@hidden>)

  • Prev by Date: Best Control for Catching a Mouse Click?
  • Next by Date: Re: How to create an empty stack view in code
  • Previous by thread: Best Control for Catching a Mouse Click?
  • Next by thread: Re: Best Control for Catching a Mouse Click?
  • Index(es):
    • Date
    • Thread