Is there a way to input multiple rows of text and save it as a variable? Like an InputField, but with multiple rows? I would like to make a simple text redactor, so that I could enter a text and then use it as a variable.
Asked
Active
Viewed 464 times
1 Answers
1
Simple InputField will work. You just need to use \[NewLine] when you need it. Create a pallete for this purpose or a shortkey, or event handler.
You can use a quick fix too:
InputField[
Dynamic[x, (x = StringReplace[#, "\\n" -> "\n"]) &],
String, ContinuousAction -> True]

so now every time you type "\n" it will create new line.
Is this what you're after?
Kuba
- 136,707
- 13
- 279
- 740
-
Ideally I would like to have smth more user-friendly since my future application will be used by people without Mathematica experience, but this will work, thx. – Wenli Sep 23 '13 at 12:24
-
@Wenli Take a look at my comment under your question – Dr. belisarius Sep 23 '13 at 12:27
-
Thx! That's a duplicate indeed. – Wenli Sep 23 '13 at 12:35