represents a text panel.


  • To use Widget["TextPanel"], you first need to load GUIKit using Needs["GUIKit`"].
  • Typically used to display HTML or RTF styled content.
  • There are three default text widgets provided within GUIKit: Widget["TextField"], Widget["TextArea"], and Widget["TextPanel"]. Widget["TextField"] is typically used for single line input using a single font, while Widget["TextArea"] would typically be used to display or take multiple line input also in a single font style. Widget["TextPanel"] is used less often, but has the benefit of displaying stylized text either as plain text, HTML 3.2 compliant text, or RTF styled text.
  • In its most basic form, Widget["TextPanel"] can display plain text just as Widget["TextArea"].
  • This widget would typically be useful to simplify laying out slightly more complicated text blocks using a single text string but including style information. You can also take advantage of the property by specifying an external source for the text content, either as a relative local file or even URL-based paths. You can also support eventing off hyperlinks in any HTML you provide in the text, allowing for custom hyperlink actions or forwarding standard web URLs to a Mathematica front end to open in the user's chosen web browser.
  • The following properties are available:
  • "text"""the text content
    "path"Nullpath or URL of the text content
    "contentType""text/plain" content type
    "editable"Truewhether the text panel can be edited
  • The property can take the values , , , and .
  • The following event is available:
  • "hyperlinkUpdate"the event triggered whenever a hyperlink in the text is activated
  • The event is only fired when the panel is not editable.

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

Click for copyable input

Display a text panel with content:

Click for copyable input
Click for copyable input

Display stylized text using HTML and set the property:

Click for copyable input
Click for copyable input

Use RTF instead of HTML:

Click for copyable input
Click for copyable input

Use an external text source:

Click for copyable input
Click for copyable input
New to Mathematica? Find your learning path »
Have a question? Ask support »