• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: TableColumn dataCell actions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >TableColumn dataCell actions (From: Angela Brett <email@hidden>)

  • Prev by Date: Re: usage of #import?
  • Next by Date: Keeping a window of the Pasteboard
  • Previous by thread: Re: TableColumn dataCell actions
  • Next by thread: Re: Calling a unix command from Cocoa ? (Marco Binder)
  • Index(es):
    • Date
    • Thread