• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Action on NSButtonCell in NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Action on NSButtonCell in NSTableView
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: = and ==
  • Next by Date: Re: Looking for Cocoa diff and hash objects/ library
  • Previous by thread: Re: [OFFTOPIC] Inspiration - This was stopped 2 hours ago
  • Next by thread: Re: Action on NSButtonCell in NSTableView
  • Index(es):
    • Date
    • Thread