NSPopUpButtonCell in custom NSTableColumn in NSTableView - not changing value
NSPopUpButtonCell in custom NSTableColumn in NSTableView - not changing value
- Subject: NSPopUpButtonCell in custom NSTableColumn in NSTableView - not changing value
- From: Andrew White <email@hidden>
- Date: Sat, 12 Mar 2005 01:17:26 +1100
I've created a custom subclass of NSTableColumn to allow me to have a
different popup menu for each cell. I override dataCellByRow and add a
setDataCellByRow method. I can populate the cell fine, but whenever I try
to change the value it immediately flicks back to the original value. I
assume I've missed something in the event handling / action chain, but I'm
not sure what.
What do I need to do to allow an NSPopupCell created via [NSPopupCell
initWithText: @"blah" pullDown: NO] to keep its value? By the time I call
- (id) tableView: (NSTableView *) aTableView
objectValueForTableColumn: (NSTableColumn *) aTableColumn
row: (int) rowIndex
the value of [selected cell] seems to have reverted to its orginal value,
not the one I changed it to.
For reference: enabled is true, and
- (void) tableView: (NSTableView *) aTableView
setObjectValue: (id) anObject
ForTableColumn: (NSTableColumn *) aTableColumn
row: (int) rowIndex
is never called.
Related question: NSTableColumn conforms to NSCoding. What - if anything -
do I need to do to ensure that my subclass plays nice with NSCoder.
Currently, I override initWithCoder to initialise my data structures but do
not try to encode any of them.
--
Andrew White
--------------------------------------------------------------------------
This email and any attachments are confidential. They may contain legally
privileged information or copyright material. You should not read, copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or unauthorised
amendment. This notice should not be removed.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden