• 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: Checkboxes in an NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checkboxes in an NSTableView


  • Subject: Re: Checkboxes in an NSTableView
  • From: j o a r <email@hidden>
  • Date: Fri, 27 Feb 2004 00:55:22 +0100

You go about things backwards, as you expect that the table view keeps
a cell instance per column * row at all times, while it in fact in the
general case keeps only one cell per column, and re-uses that cell for
all drawing in the column.

You should instead set the state of the checkbox whenever the table
view delegate method "willDisplayCell:" is called. This method provides
the cell used for drawing the current cell, update this cell with the
correct state.

j o a r

On 2004-02-27, at 00.31, Brant Sears wrote:

> I have an NSTableView that has a column of checkboxes. I'm attempting
> to
> programatically toggle the value of some of these boxes. I have code
> that
> acquires a reference to the cell by calling:
>
> NSCell* theCell = [myTableColumn dataCellForRow: theRowIndex];
>
> So, now I have an NSCell * which seems to be an NSButtonCell pointer
> which
> is what I would expect. I've attempted to call performClick on it.
> I've also
> tried calling [theCell setIntValue: NSOnState] (or NSOffState) which
> also
> doesn't work.
>
> I've even tried to enable or disable the button cell which apparently I
> can't do either.
>
> Any ideas on how I can accomplish the goal of programatically toggling
> the
> checkbox cells?

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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: 
 >Checkboxes in an NSTableView (From: Brant Sears <email@hidden>)

  • Prev by Date: Re: Checkboxes in an NSTableView
  • Next by Date: Re: Checkboxes in an NSTableView
  • Previous by thread: Re: Checkboxes in an NSTableView
  • Next by thread: Re: Checkboxes in an NSTableView
  • Index(es):
    • Date
    • Thread