I’m trying to provide a multiline editable text area for uses to type into/edit within NiftyGui. However there doesn’t seem to be anything like that in the nifty controls: Nifty Controls 1.4.2 API.
I tried making the TextField have a larger height but that just makes the area physically larger but still only with one line; returns being ignored and no wrapping.
What should be used in NiftyGui for multiline text areas?
I believe you can “trick” it by setting
wrap=“true“ to your TextField (see the Nifty manual, page 34).
However If the text extends too much, I think no arrows will appear to scroll the text, like this:
Maybe you need to create your own control.
The custom control with wrap=“true“is the direction I’m going in, although I’m surprised this isn’t already in Nifty. If I get it to work I’ll make a pull request into Nifty
This might not be exactly what you are seeking, but we used ListBox as a basis for similar thing. A chat. Nifty also has a chat control contributed, but again it is not exactly a text edit control.
I’m going to use it within my own project for a while before putting a pull request in to get the kinks out but I’ve forked nifty-gui and my text area is here
(note its in the branch textArea)
Anyone who needs it feel free to use in the mean time until I get it into Nifty-Gui proper
Known issue that I’ll fix before merging into the main repo is that clicking on the end of a wrapped line leads to the cursor going to the start of the next line (as they are both technically the same cursor position)