Checkbox in table: I want row (un)check, not checkbox (un)check

I created a table with a checkbox (nsbuttoncell) in the first column. I made a nice button in the application (below the table) that enables you to check/uncheck the selected row.

However, when you directly click the checkbox it is also checked/unchecked. For this specific application I don’t want that.

In IB I disabled the checkbox column (editable is false).

I searched the forum and found jonn8’s checkbox cells example. It looks almost exactly the same as what i do, but that application does exactly what I want, and mine doesn’t.

Another weird phenomenon is, when I compare jonn’s example and my application: In IB, all checkboxes in jonn’s tableview are “empty” (state false).
If I add an nsbuttoncell in IB, the first row is unchecked, all the other rows are “automatically” set to state true and I can’t change this back.

Does anyone know what i’m doing wrong?

The table view has a “selection changed” handler you can connect to in IB. Every time a user clicks on a row of the table this handler gets called. So you could use that to be notified when the user clicks on a row. In that handler you would need to get the currently selected row, then check the state of your checkbox, and check/uncheck it accordingly.

Hi Hank,

I’m very sorry for replying this late.
I’m using that exact same function. See below for a stripped version.

if (get clicked row of theObject) is 0 then
--disable image functions
   set enabled of button "ShowImgInfo" of window "MainWindow" to false
   set enabled of button "ShowSourceImage" of window "MainWindow" to false
--enable image functions
   if (get clicked column of theObject) = 1 then
	set checkbox_value to (contents of data cell "Use" of selected data row of theObject)
   end if
   set enabled of button "ShowImgInfo" of window "MainWindow" to true
   set enabled of button "ShowSourceImage" of window "MainWindow" to true
end if

The point however is that even though the cell, the column and the entire table is not editable, it is still possible to switch the status of the checkbox by just clicking it. I want it to act by selecting the entire row.

For the time being I have just accepted the way Applescript deals with it.

Thanks for your reply and (again) sorry for replying this late.