Checkbox in an NSTable, not getting right selectedObject()...
Checkbox in an NSTable, not getting right selectedObject()...
- Subject: Checkbox in an NSTable, not getting right selectedObject()...
- From: Jeff Dyck <email@hidden>
- Date: Mon, 21 Mar 2011 10:53:55 -0700
Hey all, once again I've hit a bit of a hiccup in an application I'm working on...
I have a table with a list of 'permissions' that I want to be able to assign by clicking on/off checkboxes.
In my script, have the following properties
property groupLocationList : {} -- A list of all group/location assignments to filter with property groupController : missing value -- Bound to an NSArrayController
The individual columns of the table are bound to the different elements of the NSArrayController groupController, which in turn is bound to the groupLocationList variable in my script.
I also have in my script a method, checkBoxClicked_(sender) that responds when I click one of the checkboxes (this is assigned via ctrl-drag from checkbox to the script controller in Interface Builder)...
on checkBoxClicked_(sender) tell groupController to set theSel to selectedObjects() set selectedGroup to item 1 of theSel
log selectedGroup end checkBoxClicked_
My problem is that the selected object seems to be behind by one click - ie: if I have the following items:
[ ] Admin [ ] Teacher [ ] Student [ ] Finance [ ] IT
If I click on Student, the result I get is Admin. If I click on student again, then I get the correct result. If I then click on IT, I get Student. If I click on IT again then I get IT as result. So it seems as if simply clicking on the checkbox doesn't update the selectedObject of the table/NSArrayController.
Any idea of how to make sure I get the right result?
Jeff |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden