I am writing an XPCE-program in which a user can enter a text in a text window which is then processed further by a Prolog program (say, by running a spelling check).
Thus, I would need a text window in which one can enter text freely (including paragraphs, punctuation marks etc.) and then store the text in a Prolog variable for further processing.
This is easy (and works well) using a text_item as follows:
send(D, append(new(Text, text_item('Enter Text'))))
However, this only allows to enter a single line, which is unsuitable for longer texts.
The "editor" environment looks well suited to this task; and I can create an editor using
send(D, append(new(Text1,editor),below))
Here, one can enter a text of many lines, including paragraphs etc. But now, how do I access the text entered by the user? It is apparently not stored in the variable Text1. I read about a text_buffer, but I do not know how to link it to the editor.