• 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
trying to make mouse cursor changes when hover an NSImageView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

trying to make mouse cursor changes when hover an NSImageView


  • Subject: trying to make mouse cursor changes when hover an NSImageView
  • From: Wilker <email@hidden>
  • Date: Thu, 25 Aug 2011 19:46:54 -0300

Hi guys,

I'm needing to make some linkable images on my software (for my about
window), the part related to click and go to link is working fine, but I
can't make the cursor change to hand (pointer) when mouse is over it, I
tried some approaches like using mouseEntered and mouseExited to handle, but
no luck, and them tried with addCursorRect, but still can't get it to
work...

How can I make it work, so user have a better idea that the images are
clickable?

This is the current code for my custom NSImageView (pretty simple):

@implementation LinkableImageView


@synthesize targetURL;


- (void)mouseDown:(NSEvent *)theEvent

{

    [super mouseDown:theEvent];



    if (targetURL) {

        [[NSWorkspace sharedWorkspace] openURL:[NSURL
URLWithString:targetURL]];

    }

}


@end
---
Wilker LĂșcio
http://about.me/wilkerlucio/bio
Kajabi Consultant
+55 81 82556600
_______________________________________________

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

  • Prev by Date: Re: rightMouseDown: never called in NSView subclass
  • Next by Date: Re: rightMouseDown: never called in NSView subclass
  • Previous by thread: Re: Sharing a persistent store between iOS and Mac
  • Next by thread: validateMenuItem Not Called for Undo: Menu Item?
  • Index(es):
    • Date
    • Thread