TableColumn dataCell actions
TableColumn dataCell actions
- Subject: TableColumn dataCell actions
- From: Angela Brett <email@hidden>
- Date: Sun, 10 Nov 2002 13:16:05 +1300
Hi,
I have an NSTableView where one of the columns' dataCell is a
checkbox. Here is the code to set up the dataCell:
NSButtonCell *checkBoxCell = [[[NSButtonCell alloc] init] autorelease];
[checkBoxCell setButtonType:NSSwitchButton];
[checkBoxCell setTarget:self];
[checkBoxCell setAction:@selector(addOrRemoveTexture:)];
[checkBoxCell setTitle:@""];
[[textureTable tableColumnWithIdentifier:BRCSUseTexture]
setDataCell:checkBoxCell];
Then in addOrRemoveTexture: I have some code which looks at the
table's clickedRow to find out which checkbox was clicked and updates
the internal data accordingly. I have implemented
tableView:willDisplayCell:forTableColumn:row: to tick the checkbox if
necessary.
The checkboxes display okay, with ticks in the right ones. The
problem is, although I know from NSLogs that the dataCell setup code
runs and the table column exists etc, the addOrRemoveTexture: action
does not get called when I click on a checkbox (I have logging in
that method to make sure.) I'm sure it used to work, and I think it
still works sometimes - I haven't figured out when it works and when
it doesn't, or what change I made since the last time I saw it
working. Am I overlooking something? I tried changing the action of
the table itself, changing whether that tableColumn is editable, and
changing when the checkBoxCell sends its action, to no avail.
Perhaps I should just make the checkBoxCell in IB instead, I hadn't
realised that was possible before.
--
Angela Brett
email@hidden
http://acronyms.co.nz/angela
_______________________________________________
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.