Using TextEditor::getTextValue()


I am having some problems with using a central Value object to store the text of a TextEditor. I assumed that the Value object exposed by the TextEditor would work in a similar way to Slider, ComboBox, Label etc. and simply using Value::referTo() would enable me to bind a new Value object to it (created from a ValueTree). This doesn’t seem to be the case as when any new text is entered into te box and then focus lost, the value is not updated.

I have created a simple app to demonstrate this (an Introjucer project). If I’m doing something stupid please let me know or if there is some method that needs to be set within the TextEditor class to enable this behaviour. I did scan the docs but couldn’t find anything. The text I am entering in the boxes is quite small, less than 1 line.


Because the TextEditor may contain large amounts of content, it would be too inefficient to update the string in the Value each time it changes, but you’re right - it should at least update it when it loses focus… I’ll take a look at that…