Re: TableColumn dataCell actions
Re: TableColumn dataCell actions
- Subject: Re: TableColumn dataCell actions
- From: Yann Bizeul <email@hidden>
- Date: Sun, 10 Nov 2002 12:32:09 +0100
Hi,
Even with your NSButtonCell for the table column, you can (should ?)
continue using
- tableView:setObjectValue:forTableColumn:row:
method of the tableView dataSource (if you use dataSource) to catch
value chaging.
See
file://localhost/System/Library/Frameworks/AppKit.framework/Versions/C/
Resources/English.lproj/Documentation/Reference/ObjC_classic/Protocols/
NSTableDataSource.html for reference.
I tried your method once without much success ;-)
Le dimanche, 10 nov 2002, ` 01:16 Europe/Paris, Angela Brett a icrit :
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.
--
Yann Bizeul
TYNSOE.ORG -
http://www.tynsoe.org/
Site technique consacri ` MacOS X
_______________________________________________
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.