mouseEntered: and mouseExited: on tableview

Discussion in 'Mac Programming' started by paos, Aug 18, 2009.

  1. paos macrumors newbie

    Joined:
    Aug 13, 2009
    #1
    I'm subclassing NSTableview so rows will highlight when mouse is over, I'm using mouseEntered: and mouseExited: but they never get called, the only method that gets called is mouseMoved:; I'm not really sure about whats happening, please help.
     
  2. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #2
    I think you have to add a trackingRect to the view. Otherwise it doesn't know that you are interested in these events, let alone whether the mouse is inside or outside.
     
  3. paos thread starter macrumors newbie

    Joined:
    Aug 13, 2009
    #3
    Thanks :) I have trackingRect on awakefromnib, but ir seems it works for the entire tableview, hoy can I make it work for each row??
     
  4. paos thread starter macrumors newbie

    Joined:
    Aug 13, 2009
    #4
    trackingRect:

    How con I set up a custom tableView to create trackingRects for every row??
     
  5. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #5
    Create your own custom cell and do the tracking in that?
    Or maybe this?
    tableView:shouldTrackCell:forTableColumn:row:

    (Did you look around in the documentation?)
     

Share This Page