pointingHandCursor
-
Hi all,
I've got an NSTextField. This field is filled with an
NSAttributedString that contains a link to a website.
When the mouse moves over this field I want the pointingHandCursor to
be shown.
My code in the WindowController:
[[myTextField addCursorRect:[myTextField frame] cursor:[NSCursor
pointingHandCursor]];
[[self window]enableCursorRects];
Why doesn't this work? These statements have no effect at all, cursur
is IBeamCursor over the NSTextField.
Any ideas?
_______________________________________________
cocoa-dev mailing list | <cocoa-dev...>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored. -
I would suggest having a look at the Sample Code section on the Apple
Web site:
http://developer.apple.com/samplecode/Sample_Code/Cocoa.htm
There is a sample code named: "TextLinks" which is doing what you're
trying to achieve. It's working really well.
On Wednesday, December 3, 2003, at 10:44 AM, Ruben Smits wrote:
> Hi all,_______________________________________________
>
> I've got an NSTextField. This field is filled with an
> NSAttributedString that contains a link to a website.
> When the mouse moves over this field I want the pointingHandCursor to
> be shown.
>
> My code in the WindowController:
> [[myTextField addCursorRect:[myTextField frame] cursor:[NSCursor
> pointingHandCursor]];
> [[self window]enableCursorRects];
>
> Why doesn't this work? These statements have no effect at all, cursur
> is IBeamCursor over the NSTextField.
>
> Any ideas?
cocoa-dev mailing list | <cocoa-dev...>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored. -
Thanks, this helps. The magic was to override the resetCursorRects.
On 3-dec-03, at 12:29, Stephane Sudre wrote:
> I would suggest having a look at the Sample Code section on the Apple_______________________________________________
> Web site:
>
> http://developer.apple.com/samplecode/Sample_Code/Cocoa.htm
>
> There is a sample code named: "TextLinks" which is doing what you're
> trying to achieve. It's working really well.
>
> On Wednesday, December 3, 2003, at 10:44 AM, Ruben Smits wrote:
>
>> Hi all,
>>
>> I've got an NSTextField. This field is filled with an
>> NSAttributedString that contains a link to a website.
>> When the mouse moves over this field I want the pointingHandCursor to
>> be shown.
>>
>> My code in the WindowController:
>> [[myTextField addCursorRect:[myTextField frame] cursor:[NSCursor
>> pointingHandCursor]];
>> [[self window]enableCursorRects];
>>
>> Why doesn't this work? These statements have no effect at all, cursur
>> is IBeamCursor over the NSTextField.
>>
>> Any ideas?
cocoa-dev mailing list | <cocoa-dev...>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


