Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handle Double-click Mouse Event and Return Pressed for NSTableView

OK, what I need is pretty straightforward, though I can still find nothing specific.

I want to be able to :

  • track double-click events
  • track when the NSTableView is in focus, and the "Return" key is pressed.

How would you go about it?

P.S. I've had a look into NSTableViewDelegate specification, but I can't find anything useful.

like image 941
Dr.Kameleon Avatar asked Sep 19 '25 21:09

Dr.Kameleon


1 Answers

For double click you need to do just these :

-(void)awakeFromNib{
    [self.tableView setDoubleAction:@selector(thisMethod)];
    //And if you wish to take selector dynamically, I guess you know how to do :)
}

-(void)thisMethod{
    NSLog(@"double clicked");
}
like image 146
Anoop Vaidya Avatar answered Sep 23 '25 11:09

Anoop Vaidya