I have simple Spec object with textArea and textInputField. Next to it I have another object which Spec doesn't know about. When I write some text into textInputField i need to send message with this text to the other class. I tried announcer, but it doesn't work. Is there any way to inform other object and send it this text?
you are looking for acceptBlock:
which will call a block every time the text value changes:
| cm |
cm := TextInputFieldPresenter new.
cm autoAccept: true.
cm acceptBlock: [ :txt | doSomething with: txt.].
you can find this and more about spec in the spec booklet: http://books.pharo.org/spec-tutorial/
note that in newer versions of pharo the spec classes have been renamed from ...Model
to ...Presenter
which is not yet reflected in the booklet. so whether you use TextInputFieldModel
or TextInputFieldPresenter
depends on your pharo version.