Clickable links with NSTextField

Discussion in 'Mac Programming' started by xmax, Mar 30, 2009.

  1. macrumors member

    Joined:
    Jul 3, 2008
    #1
    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
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Probably need to set it with addCursorRect:cursor:
     
  3. thread starter macrumors member

    Joined:
    Jul 3, 2008
    #3
    I am trying this code :
    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
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    If you don't already have an NSTextField subclass, make one and put this in it:

    Code:
    - (void)resetCursorRects
    {
        [self addCursorRect:[self bounds] cursor:[NSCursor pointingHandCursor]];
    }
     
  5. thread starter macrumors member

    Joined:
    Jul 3, 2008
    #5
    Thanks For Your reply.
    I made Sub Class for NSTextField and it's working now.


    Thanks

    xmax.
     

Share This Page