TextView
Supports Offload
TextView[string_String, opts___]represents a text field used for displaying static or dynamic textual data
Options
"Event"
If specified it acts like an InputText.
"Description"
adds description label
"Placeholder"
adds placeholder of the given string is empty
ImageSize
sets the width in pixels
"Label"
adds a label at the left side to the text field
Appearance
by the default is Automatic. By setting to any other value it will remove borders and other styling
Application
Show large text blocks
Import a text file and show it as text:
Import["file.txt", "Text"] // TextViewLine breaks will also work:
TextView["Hey!\nThere"]Use ImageSize to limit maximum size and introduce scroll bars if needed:
TextView["A very long line here", ImageSize->100]Dynamic indication
There are various of applications. For example to display the current coordinates on a graph
pointer = {0.,0.} // ToString;
Plot[Sinc[x], {x,-10,10}, Prolog->{
White, EventHandler[Rectangle[{-10,-10}, {10,10}], {"mousemove" -> Function[xy, pointer = xy // ToString]}]
}]
TextView[pointer // Offload]