Re: Hyperlinks in Table Views
Re: Hyperlinks in Table Views
- Subject: Re: Hyperlinks in Table Views
- From: Corbin Dunn <email@hidden>
- Date: Wed, 27 Jan 2010 15:44:19 -0800
> I think I may have got this to work, so here goes:
>
> The data cell for the table column displaying the hyperlink is now a custom NSTextFieldCell with the following implementation over-ridden:
>
> - (NSUInteger)hitTestForEvent: (NSEvent *)event
> inRect: (NSRect)cellFrame
> ofView: (NSView *)controlView
> {
Using hitTestForEvent: isn't a good place to do this. It will be called multiple times, and possibly not when you expect it to be (ie: not just for NSLeftMouseDown).
You still probably want to return NSCellHitTrackableArea when the user hits a link, but do the actual URL opening in trackMouse:inRect:ofView:untilMouseUp:
-corbin
_______________________________________________
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