I would like to validate the contents of an NSTextFieldCell when the user has finished editing it.
The NSTextFieldCell is in a table column in a document-based application. An array controller manages the values, and that one works. The text field is editable. The NSTextFieldCell's attribute in IB for Action is set to "Send On End of Editing".
The NSTextFieldCell is bound to an outlet (File's owner) via a property thus:
property theTextField : missing value --bound as an outlet to the NSTextFieldCell in IB In the code I then say:
theTextField's setAction_("theValidation:") --this method is in the documentation for NSActionCell, "theValidation:" is a selector.
The expectation is that the following handler would be called after editing the text field:
on theValidation_(sender) display dialog "works" end theValidation_
The target is by default set to nil to allow it to be determined at run time. That should be ok for me, but I also tried to set it: theTextField's setTarget_(me)
But that did not solve anything.
What am I doing wrong, or misunderstand, or is there a smarter method?
PS: the prefix "the" in the property and handler names is actually something different in the real code, I just cleaned it from unnecessary clutter. |