Action on NSButtonCell in NSTableView
Action on NSButtonCell in NSTableView
- Subject: Action on NSButtonCell in NSTableView
- From: Pierre Bernard <email@hidden>
- Date: Tue, 25 May 2004 23:19:47 +0200
Hi!
I have created a table which uses a subclass of NSButtonCell for data cell. I have seen differing methods for implementing this and went with this remarkably simple set-up:
NSTableColumn * column = [[NSTableColumn alloc] init];
ThumbnailCell * dataCell = [[ThumbnailCell alloc] init];
[column bind:@"value" toObject:pageRollController withKeyPath:@"arrangedObjects.self" options:[NSDictionary dictionary]];
[dataCell setTarget:self];
[dataCell setAction:@selector(loadPage:)];
[pageRollView addTableColumn:column];
[column setDataCell:dataCell];
[dataCell autorelease];
[column autorelease];
The catch being that all buttons have the same action. I would need to know which button was pressed. Here I was hoping for the sender argument to the action to be of some help. Unfortunately the sender always is the table view not the button cell.
Somebody must have done this and care to share the obvious I am missing
TIA
Pierre
---
Spinning WebObjects or cooking up Cocoa in Switzlerland?
Let me know:
http://homepage.mac.com/I_love_my/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.