• 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: Position of the mouse
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Position of the mouse


  • Subject: Re: Position of the mouse
  • From: email@hidden
  • Date: Thu, 27 Mar 2003 21:56:28 +0100

On jeudi, mars 27, 2003, at 09:23 PM, Luca Torella wrote:

Hello,
I have a subclass of an NSView, and I want that, when the mouse is over the NSView, it writes the current position of the mouse (X,Y) in two NSTextView.
I tried to used the event -mouseMoved of NSResponder Class, but it doesn't work.
How can I write the position?

I've been playing with this and didn't find any good solution.

To make mouseMoved work you need to set the window to send mouseMoved message:

setAcceptsMouseMovedEvents:

And mouseMoved are only sent to the first responder.

This means that if you click on the window title bar in some cases, mouseMoved is not send anymore.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Position of the mouse
      • From: Quentin Mathé <email@hidden>
References: 
 >Position of the mouse (From: Luca Torella <email@hidden>)

  • Prev by Date: Re: Size of a bundle (or directory)
  • Next by Date: Re: Size of a bundle (or directory) [A: du -k -s]
  • Previous by thread: Position of the mouse
  • Next by thread: Re: Position of the mouse
  • Index(es):
    • Date
    • Thread