You can easily add a slider to a table view, like this:
var dataColumn = [[CPTableColumn alloc] initWithIdentifier:"Slider"];
[table addTableColumn:dataColumn];
[[dataColumn headerView] setStringValue:"Slider (Editable)"];
[dataColumn setEditable:YES];
[dataColumn setWidth:140];
[dataColumn setDataView:[[CPSlider alloc] initWithFrame:CGRectMakeZero()]];
The slider will automatically reflect the cell values read from your data source or binding as long as you make sure the values are numbers.
Unfortunately, as you noted, since the slider is not a button the table will not send tableView:setObjectValue:forTableColumn:row:
messages for it. You could subclass CPSlider
to have it return YES
to isKindOfClass:[CPButton class]
.
This rightly feels like a hack so for a better long term solution, check how Cocoa handles a CPSlider cell. If Cocoa sends tableView:setObjectValue:forTableColumn:row:
for the slider, go ahead and post up a feature request and include your little Cocoa test app to demonstrate it. Cappuccino strives to work the same way as Cocoa in these matters.