• 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
Event handling and tracking rect question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Event handling and tracking rect question


  • Subject: Event handling and tracking rect question
  • From: "Christian Moen" <email@hidden>
  • Date: Sun, 18 Mar 2007 02:01:05 +0900

cocoa-dev,

I'm working on an application with a custom view and I have a question
on event handling and tracking rects.

My custom view area contains several tracking rects which capture
mouse movement in the view.  As the user moves his mouse, I'd like to
highlight the active part of the view indicated by the tracking rect
being entered.  I get a mouseEntered: call when the mouse activates a
new tracking rect and everything is working as expected.

My question is: How should I handle the case when my window with the
custom view is being opened under the mouse pointer?  My custom view
doesn't seem get an initial mouseEntered: call.  Is there a way to get
this?

I'm setting up my tracking rects in my custom view's
viewDidMoveToWindow method.  I'm getting the mouse position using my
window's mouseLocationOutsideOfEventStream method, converting it to
view coordinates and setting assumeInside:YES when the cursor is
inside a tracking rect when the tracking rects are added.  I've
verified that these tests work out fine, but I'm still not getting an
initial mouseEntered: call.

Should I expect an initial mouseEntered: call?  Is the above the
correct way of doing what I want?  I've been considering sending a
mouseEvent myself to accomplish his, but that doesn't seem like the
right way of doing things.  Any help on this is mostly appreciated.

Many thanks,


Christian _______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Event handling and tracking rect question
      • From: "John C. Randolph" <email@hidden>
  • Prev by Date: Re: Renaming the "Cancel" button for NSOpenPanel
  • Next by Date: Re: capturing a double-click on a control
  • Previous by thread: popup bindings initial object
  • Next by thread: Re: Event handling and tracking rect question
  • Index(es):
    • Date
    • Thread