My endgoal is to have a box in the GUI into which the user can type csound code, and then press a “compile” button and have it compiled on-the-fly with compileorc.
This led me to checking out the texteditor / textbox widgets but I am highly confused. First of all, there’s no textbox entry in the docs, although there is an example under File>Examples>Widgets>textbox. I don’t understand what this example is supposed to be doing. Is Csound somehow receiving the text I type as a string? Is it being written to the text file? I can edit the text in the box, but I can’t add a newline by pressing enter, Ctrl+Enter, Shift+Enter, or Alt+Enter (I’m using Windows).
The docs entry for texteditor mentioned multiline vs. singleline mode but there is no information on how to to set this mode. I do see how the up/down buttons work in the texteditor example to scroll through the previous strings. I suppose one could use this functionality to rig Csound to recieve the code one line at a time, each time in a new string variable, and concatenate them to create the file, but this wouldn’t be very helpful if I wanted to go back in and change a previous line…
I already have created some very useful standalones that do what I want using a textfile: I edit the textfile in notepad while the program is running, and when I press the compile button, compileorc is called to read the text file. This works great, its just I don’t want to have to use notepad. I want to be able to edit the code right in the GUI window.
Actually the most useful thing would be to have the multiline text that I enter into the widget get saved as a text file, and then immediately compiled with compile orc. That way the code I write would get saved.