Re: New lines in InputField
- To: mathgroup at smc.vnet.net
 - Subject: [mg117712] Re: New lines in InputField
 - From: "Chris Degnen" <degnen at cwgsy.net>
 - Date: Wed, 30 Mar 2011 04:11:55 -0500 (EST)
 
Aha, got it.
CreateDialog[{TextCell["Enter your text here:"], 
   InputField[Dynamic[input], String, FieldSize -> {50, 12}], 
   DefaultButton[
    DialogReturn[CreateDocument[TextCell[input, "Print"]]]]}, 
  NotebookEventActions -> {"ReturnKeyDown" :> 
     FrontEndTokenExecute["HandleShiftReturn"]}];
> Can anyone suggest how to enter new lines in input text,
> preferably using the return key?
> In the example below I can paste into an input field a piece
> of text which includes new lines, such as these two sentences,
> but new lines can't be typed straight in to the input field,
> as users are wont to do.
> 
> 
> CreateDialog[{TextCell["Enter your text here:"], 
>   InputField[Dynamic[input], String, FieldSize -> {50, 12}], 
>   DefaultButton[
>    DialogReturn[CreateDocument[TextCell[input, "Print"]]]]}, 
>  NotebookEventActions -> {}];
> 
>