• 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
cursorUpdate was called, but cursor was not updated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cursorUpdate was called, but cursor was not updated


  • Subject: cursorUpdate was called, but cursor was not updated
  • From: Peng Gu <email@hidden>
  • Date: Fri, 05 Apr 2013 13:25:05 -0400

I have a custom button, which was added as a subview of a textview. And I
want the cursor to be changed to arrowCursor instead of the beam cursor
when hover on the button.

So I added tracking area. The cursorUpdate method was indeed called, but
the cursor was still the beam cursor. It seems the cursor was changed back
to beam cursor after cursorUpdate method was called.

Any ideas?


- (void)cursorUpdate:(NSEvent *)event {
    [[NSCursor arrowCursor] set];
}

// myAddTrackingArea is called in awakeFromNib.
- (void)myAddTrackingArea {
    [self myRemoveTrackingArea];

    NSTrackingAreaOptions trackingOptions = NSTrackingCursorUpdate |
NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow;
    _trackingArea = [[NSTrackingArea alloc] initWithRect: [self bounds]
options: trackingOptions owner: self userInfo: nil];
    [self addTrackingArea: _trackingArea];
}

- (void)myRemoveTrackingArea {
    if (_trackingArea)
    {
        [self removeTrackingArea: _trackingArea];
        _trackingArea = nil;
    }
}
_______________________________________________

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: cursorUpdate was called, but cursor was not updated
      • From: Steve Mills <email@hidden>
  • Prev by Date: Re: Providing a Service without activating an app
  • Next by Date: Re: cursorUpdate was called, but cursor was not updated
  • Previous by thread: Re: Accessing members from NSDictionary
  • Next by thread: Re: cursorUpdate was called, but cursor was not updated
  • Index(es):
    • Date
    • Thread