Re: clickable NSImageView
Re: clickable NSImageView
- Subject: Re: clickable NSImageView
- From: Tolga Katas <email@hidden>
- Date: Tue, 17 Jun 2008 08:27:30 -0700
check out, resetCursorRects
- (void) resetCursorRects
{
[super resetCursorRects];
[self addCursorRect: [self bounds] cursor: [NSCursor
pointingHandCursor]];
}
On Jun 17, 2008, at 8:17 AM, Angelo Chen wrote:
Hi,
I use the code at the end to let user click on an image and open a
URL, this works, but not really satisfactory as when the mouse is
moved over the image, the cursor was not changed to point-hand
shape, any idea to improve this? Thanks,
Angelo
@interface BannerView : NSImageView
{
}
- (void)mouseDown:(NSEvent *)theEvent
{
if ([theEvent clickCount] ==1) {
NSURL *url = [NSURL URLWithString:@"http://www.cnn.com"];
[[NSWorkspace sharedWorkspace] openURL: url];
}
}
Yahoo! Mail具備一流的網上安全保護功能,請前往
http://hk.antispam.yahoo.com/ 了解更多相關資訊!
_______________________________________________
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:
@gmail.com
This email sent to email@hidden
_______________________________________________
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