Skip navigation.
 
mlRe: ColorCell, NSActionCell subclass
FROM : Carl Gieringer
DATE : Tue Apr 19 23:33:18 2005

For posterity:

The technique that John Harte uses appears to be the best option so
far.  As far as I can tell, NSTableView is only friendly towards text
cells that want to edit themselves.  It does this by setting up the
field editor when a user double clicks on a text cell for which the
table view is the delegate.  To have a color cell that had similar
behavior but for colors, NSTableView would need to have code for
setting up a color panel and listening to it (it would pass along any
new colors to its data source, or to its bound values in the case of
bindings.)  Since NSTableView does not have this capability, having a
separate object control the process is easiest right now.  If one were
to try to add this ability to a table view, I believe that

- (void)editColumn:(int)columnIndex row:(int)rowIndex
withEvent:(NSEvent *)theEvent select:(BOOL)flag

would be the correct method to override.  This is the method that sets
up the field editor, and so it would be the correct place for a table
view subclass to grab a color cell's edit.

peace on earth, goodwill toward mankind etc. etc.

Related mailsAuthorDate
mlColorCell, NSActionCell subclass Carl Gieringer Apr 18, 07:53
mlRe: ColorCell, NSActionCell subclass Carl Gieringer Apr 18, 20:59
mlRe: ColorCell, NSActionCell subclass Carl Gieringer Apr 19, 23:33