• 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: Setting cursor for subview of NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting cursor for subview of NSTextView


  • Subject: Re: Setting cursor for subview of NSTextView
  • From: email@hidden (Stefan Haller)
  • Date: Sat, 13 Mar 2010 17:11:56 +0100

Martin Wierschin <email@hidden> wrote:

> > I have a custom NSTextAttachmentCell that does its work by adding
> > subviews to the NSTextView (e.g. NSButtons). This works fine.
> >
> > What I can't get to work is cursor handling; I always get an arrow
> > cursor when the mouse is over my views. I overwrite resetCursorRects,
> > like this:
> ...
> > This doesn't help.  Getting desperate, I tried implementing
> > mouseMoved:, but it's not even called
>
> Overriding mouseMoved is unfortunately required if you want to
> customize the mouse cursor in NSTextView (see this post by the helpful
> Mr Davidson).

What I missed was that in order to receive mouseMoved events, you need
to set a tracking area first; I had assumed that mouseMoved: is
automatically called for the deepest view under the mouse that
implements it.  (Reading the docs can help at times...)

After overriding updateTrackingAreas in my subview and installing a
suitable NSTrackingArea, things work in most situations; I then still
had to override mouseMoved: in the NSTextView though, and keep it from
calling super if the subview had set the cursor, otherwise the cursor
would still be reset to an arrow in certain cases.

Thanks for the help (also to Douglas, who sent me private mail).

-Stefan


--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
_______________________________________________

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: 
 >Re: Setting cursor for subview of NSTextView (From: Martin Wierschin <email@hidden>)

  • Prev by Date: Re: Which iPhone Program?
  • Next by Date: Re: Which iPhone Program?
  • Previous by thread: Re: Setting cursor for subview of NSTextView
  • Next by thread: Clicking on an NSColorWell
  • Index(es):
    • Date
    • Thread