[MacRuby-devel] get and set a checkbox in tableview
Pavlos Vinieratos
pvinis at gmail.com
Sat Apr 30 03:11:08 PDT 2011
for some reason, when I put the initial test data in the table view and
reloadData, The checkboxes that should be checked, aren't.
If I upload it on github, could you take a quick look? It's a small project
at the moment.
On Sat, Apr 30, 2011 at 3:24 AM, James Chen <ashchan at gmail.com> wrote:
> In tableView:objectValueForColumn:row:, return ruby true or false should be
> enough to make the checkbox checked or unchecked. Be sure to check the
> tableColumn.identifier so that you're actually dealing with the checkbox
> column.
>
> Normally you don't have to do anything
> in tableView:setObjectValueForColumn:row to check/uncheck the checkbox. When
> the user clicks the checkbox, this method is called and you could persistant
> the object value. Do check the tableView:setObjectValueForColumn:row too.
>
> Here's some real snippet: http://bit.ly/m98G2P
>
> Hope this helps.
>
> ---
> James Chen
> ashchan.com | @ashchan <http://twitter.com/ashchan>
>
>
> On Sat, Apr 30, 2011 at 2:30 AM, Pavlos Vinieratos <pvinis at gmail.com>wrote:
>
>>
>>
>> Hello. I am writing a little app, and I have a table view with a checkbox
>> cell and a text cell in each row.
>>
>> I implemented the data source, and in tableView:objectValueForColumn:row:,
>> in the checkbox row I just return NSOnState or NSOffState, but when I run
>> the app, the checkboxes don't get checked where they should.
>> Also, when one is checked, how can I uncheck it through
>> tableView:setObjectValueForColumn:row?
>>
>> thank you
>>
>>
>> --
>> Pavlos Vinieratos
>>
>>
>>
>> --
>> Pavlos Vinieratos
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
--
Pavlos Vinieratos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110430/e557d453/attachment.html>
More information about the MacRuby-devel
mailing list