Catching double click (any mouse events) in an NSTableView
Catching double click (any mouse events) in an NSTableView
- Subject: Catching double click (any mouse events) in an NSTableView
- From: Eric Giguere <email@hidden>
- Date: Mon, 01 Mar 2010 09:26:40 -0500
Hi all
I'm a newbie with the Mac programming and been trying for a couple of hours to do something that should be straightforward, no success so I'm asking the Pros for some help :).
I'm have a small application, using Core Data, that shows in the Main Window a list of entities. I'm trying to trap mouse events to have another window opened when double clicking on an item.
I created a controller for my window and have it override the mouseDown: , works but only for mouse event it the window itself, not its controls.
I did the same thing for the TableView, created a controller for it. But on this one, no mouseDown events ever get sent.
- (void)mouseDown:(NSEvent *)theEvent {
NSLog(@"Mouse Event received in the list view!!!");
// [theEvent:
}
I tried then on this same TableView controller to have the delegate method:
- (void)textView:(NSTextView *)aTextView clickedOnCell:(id < NSTextAttachmentCell >)cell inRect:(NSRect)cellFrame atIndex:(NSUInteger)charIndex {
NSLog(@"Mouse click event in the text view...");
}
Failed again, this doen't do anything.
But, if in this class I declare a delegate for a method directly on the TableView
- (void) tableView:(NSTableView*)tableView mouseDownInHeaderOfTableColumn:(NSTableColumn *)tableColumn {
NSLog(@"Mouse event in the table view...");
}
Now this method gets called!
So guys, what am I getting wrong here? How can I catch the mouse click in a TableList? I guess when doing it correctly for this one, it will be the same for all other controls.
Any help will be greatly appreciated, Thank you very much!
Eric
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden