• 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: How can I detect a mouse click outside a child window on Leopard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I detect a mouse click outside a child window on Leopard?


  • Subject: Re: How can I detect a mouse click outside a child window on Leopard?
  • From: Uli Kusterer <email@hidden>
  • Date: Wed, 15 Feb 2012 10:14:57 +0100

On 14.02.2012, at 14:39, Michael Crawford wrote:
> I was just looking at the documentation for NSApplication and wondering if overriding sendEvent is the way to go?  I was thinking I could monitor events dispatched to my app and then, when one arrives that is not destined for the child window, dismiss the popover.  I can also dismiss the popover if the application loses focus.

 Might be a bit hard to avoid dismissing on clicks in the menu bar though ... but I might be mixing that up with Carbon. Does sendEvent: get menu bar clicks?

 But yeah, that's what I would use. I thought there was a way to install an event filtering/monitoring callback on NSApplication, but I can't find the call right now. Anyway, it's probably 10.7-only, at best 10.6.

 Failing that, you could create a transparent, borderless window with a custom content view that handles mouse clicks and closes your fake popover (and itself), I suppose. Might have to call -preventWindowOrdering in there too, in case someone uses Spaces or Exposé to select your blanking window or otherwise screw up window ordering.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.masters-of-the-void.com




_______________________________________________

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: How can I detect a mouse click outside a child window on Leopard?
      • From: Seth Willits <email@hidden>
References: 
 >How can I detect a mouse click outside a child window on Leopard? (From: Michael Crawford <email@hidden>)
 >Re: How can I detect a mouse click outside a child window on Leopard? (From: Michael Crawford <email@hidden>)

  • Prev by Date: IKPictureTaker crash
  • Next by Date: Re: -[NSOutlineView ibIsInDesignMode]: unrecognized selector (???)
  • Previous by thread: Re: How can I detect a mouse click outside a child window on Leopard?
  • Next by thread: Re: How can I detect a mouse click outside a child window on Leopard?
  • Index(es):
    • Date
    • Thread