on setHours_(sender)
set theValue to hoursStepper's integerValue()
hoursTextField's setStringValue_(theValue)
end setHours_
and it does update the text field ok. The text field is bound to the selection in a table along with other checkboxes and controls. The bindings work well, as expected. If I edit the text field and change table selections back and forth, its value is retained. but when I set the value programmatically, from the stepper, It shows Ok but then when the table selection changes away and back again, it goes back to the original value before the stepper’s setting. So the value is not retained by the bindings unless I enter the text manually.
I tried to select the text of the field to maybe make it ‘stick’ but no luck.
Thanks, richard,
That’s pretty nice. I’ll use that. unfortunately I still have my problem though - the stepper’s values are retained but the bindings but the text field values always revert to the pre-stepped value.
the table that they are bound to has it’s content bound to a record property and I think somehow that property isn’t getting updated? Really in the dark on this one. i
table’s fault, do it without the direct link, meaning you might need to abandon the take from, dunno Then again I’m know the minimum of bindings it might be a setting.
Anything that is set programmatically, whether a text field or checkbox state, will not be retained by the bindings.
This is my old set up:
Text fields
Checkboxes
Stepper
are all bound to the selection of table 1, so they change as you change the table’s selection to a new row. This has been working well but I am not sure how to approach this now. When you change anything manually, the values are retained but programmatically they are not. I will try to update the view somehow or the record that is bound to everything perhaps… help?
I am using bindings to connect my table to the content and the checkboxes etc.
I want to set some of the checkboxes to not-enabled which again I can do programmatically but when selection changes the enabled state is not preserved. In the old ASS app I used 'on selection changed" to update the states of the UI.
How can I implement “on selection changed” for the table or otherwise receive notification of the change?
In your selection did change handler you need to set the values based on the selection. There is no shortcut to this. You will have to set your properties to the values in the array based on the current selection. Then your UI elements will update correctly.
OK _ Just, on a chance, I hooked up the table as delegate to my script and added an outlet, aTableView, for it to the script and it works!
on tableViewSelectionDidChange_(aTableView)
--make my changes in the UI
end tableViewSelectionDidChange_
I also realized i could just add more keys to the array for the enabled aspect of the checkboxes and it should all be automatic, though it will be a long string of key-values.
thanks Craig, Rob
ps really enjoyed the first two movies - keep em coming!