• 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: No mouseExited when switching windows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No mouseExited when switching windows


  • Subject: Re: No mouseExited when switching windows
  • From: Steve Mills <email@hidden>
  • Date: Wed, 20 Feb 2013 09:55:02 -0600

On Feb 19, 2013, at 17:37:26, Shane Stanley <email@hidden> wrote:

> Don't you mean:
>
> 	[center addObserver:self selector:@selector(windowDidResignKey:)

Doh! Thanks. First time I've used @selector since the early days of Cocoa.

So now I have that working, and am handling mouseEntered, mouseMoved, mouseExited, and cursorUpdate for my control. The only thing that's not yet right is what to do after this series of events:

1. Move the mouse into my control. I hilite a specific area with the "hover" image.
2. Command-` to switch to another window that may or may not intersect with the first window (doesn't matter). I have *not* moved the mouse. I get a windowDidResignKey message, so I remove the hilite.
3. Command-` back to the first window, still without moving the mouse, which is still inside my tracking area.

At this point, I should hilite that same area with the "hover" image. Yet I can't because the only thing I can think of doing the "right" way would be to receive a NSWindowDidBecomeKeyNotification notification. But this doesn't give me the current mouse location. I could ask NSEvent for its global mouse location, but that doesn't sound very Cocoa-y. And I can't save and restore the state because the mouse *could* have moved while the 2nd window was active.

I just wish NSTrackingArea would send mouseExited with the window loses its mainness or keyness (choosable by the owner) and a mouseEntered when becoming main/key. That makes the most logical sense.

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157



_______________________________________________

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: No mouseExited when switching windows
      • From: Kyle Sluder <email@hidden>
References: 
 >No mouseExited when switching windows (From: Steve Mills <email@hidden>)
 >Re: No mouseExited when switching windows (From: Fritz Anderson <email@hidden>)
 >Re: No mouseExited when switching windows (From: Steve Mills <email@hidden>)
 >Re: No mouseExited when switching windows (From: Shane Stanley <email@hidden>)

  • Prev by Date: Issue with Custom View Drag and Drop
  • Next by Date: Re: No mouseExited when switching windows
  • Previous by thread: Re: No mouseExited when switching windows
  • Next by thread: Re: No mouseExited when switching windows
  • Index(es):
    • Date
    • Thread