PDA

View Full Version : Clickable links with NSTextField




xmax
Mar 30, 2009, 12:52 PM
Hello,
I follow the code at following link.

http://lists.apple.com/archives/cocoa-dev/2005/May/msg02012.html

I am not getting hand icon on NSTextfield . once i clicked on textfield it displays hand icon and it changes it fonts and text color slightly.
it does not Provide me hand icon when i roll over mouse on text filed at start up.


Thanks,

xmax



kainjow
Mar 30, 2009, 01:13 PM
Probably need to set it with addCursorRect:cursor:

xmax
Mar 31, 2009, 02:21 AM
I am trying this code :

[aView addCursorRect:[aLabel frame] cursor:[NSCursor pointingHandCursor]];


but i am not getting it work. do i need to set any property in Interface Builder.
I have seen 2 to 3 threads with same problem.
but not providing solution to this.

TextField not displaying pointinig hand cursor when i hand over mouse on label.


Thanks,

xmax

kainjow
Mar 31, 2009, 09:43 AM
If you don't already have an NSTextField subclass, make one and put this in it:

- (void)resetCursorRects
{
[self addCursorRect:[self bounds] cursor:[NSCursor pointingHandCursor]];
}

xmax
Mar 31, 2009, 10:10 AM
Thanks For Your reply.
I made Sub Class for NSTextField and it's working now.


Thanks

xmax.