PLUG'N SCRIPT
rapid plugin development
Tutorial
DSP
KUIML
How-to
Scripts
  • Overview
  • Tutorial
  • Reference
  • Built-in variables
  • Runtime model
  • Parameters mapping
  • Script converter
  • LetiMix
    • Text Widget
      • BBCode
      • Themes
KUIMLLetiMixText Widget
December 10, 2025

TEXT_WIDGET

This element is created for displaying and editing multiline text. It supports various modes of operation, plain text, bbcode, lists, tables and more.

Attributes brief detailed show all inherited

Name DescriptionDefault
idIdentifier of the elementIf id is given, it is used for the main WIDGET of TextWidget, so that you can access exposed WIDGET attributes, as well as some other TextWidget exposed attributes. The id of an element has to be globally unique. If you don't specify the id it'll be auto-generated.
textStatic text to display (also can use 'value' for compatibilty with TEXT)When the string_id or param_id attribute is used, this attribute is not taken into accountempty
string_idString id to display/editOverrides 'text' if setempty
param_idParameter id to display/editOverrides 'text' and 'string_id' if setempty
Size and position
Exposed: v. 1.9.1 (pixels)widthdefault width in pixels / relative in percentage / auto (or empty)If TextWidget is resizable this is a default (starting) value. If set in percentage, then horizontal resizing is disabled. If is empty or "auto" then width is auto-calculated from content width (considering min/max_width).empty
Exposed: v. 2.0min_widthminimum width in pixels (for resizing)Used when resize="both" or "horizontal" and width is empty (auto) or fixed (not in percentage)200
Exposed: v. 2.0max_widthmaximum width in pixels (for resizing)Used when resize="both" or "horizontal" and width is empty (auto) or fixed (not in percentage)1000
Exposed: v. 1.9.1 (pixels)heightdefault width in pixels / relative in percentage / auto (or empty)If TextWidget is resizable this is a default (starting) value. If set in percentage, then vertical resizing is disabled. If is empty or "auto" then height is auto-calculated from content height (considering min/max_height)empty
Exposed: v. 2.0min_heightminimum height (for resizing)Used when resize="both" or "vertical" and height is empty (auto) or fixed (not in percentage)30
Exposed: v. 2.0max_heightmaximum height (for resizing)Used when resize="both" or "vertical" and height is empty (auto) or fixed (not in percentage)750
Exposed: v. 1.5h_alignHorizontal alignment of the widget in its parent cellempty
Exposed: v. 1.5v_alignVertical alignment of the widget in its parent cellempty
Exposed: v. 1.5h_marginhorizontal margin of the widget2
Exposed: v. 1.5v_marginvertical margin of the widget5
Exposed: v. 1.9.1v_offsetvertical offset of the widgetUsing this property lets you move a widget without changing the layout around it. The position is relative to the parent cell0
Exposed: v. 1.6visibleshow/hide the widget (does not impact the layout)true
Exposed: v. 1.5displayshow/hide the widgetWhen set to false, the content of the widget is not displayed (not visible) AND is not taken into account to compute the layout (the widget is ignored)true
Content positioning
h_padhorizontal padding of the text contentDefines the space between text content and the edges or the content area. Can be set for left and right separately: h_pad="10;20"6
v_padvertical padding of the text contentDefines the space between text content and the edges or the content area. Can be set for top and bottom separately: v_pad="5;15"6
h_clipadditional h-clipping of the content areacan be set for left and right separately: "10;5"0
v_clipadditional v-clipping of the content areacan be set for top and bottom separately: "4;6"0
Exposed: yestext_h_alignhorizontal text alignmentCan be further adjusted with bbcode (if enabled) using [left], [center], [right] or [justify]left
Exposed: yestext_v_alignvertical text alignmenttop
Font-related
font_faceFont name (face) with optional bold and italicYou can put 'bold' or 'italic' here as well: "Arial;bold;italic".
Default font is monotype: Consolas for Windows, Menlo for MacOS
OS depe...
Exposed: current font sizefont_sizeFont size (with optional min and max values)If you set min and max (ex. "12;8;40") values then quick font-resizing will be available using mouse (Ctrl+wheel) and keyboard Ctrl + "+" or "-".
To return to default font-size use Ctrl+click or Ctrl+"0"
14;6;50
font_size_persistentIs font size remembered after font-resizefalse
font_resize_follow_ratioHow much other elements are resized on font-resizeThis determines how other elements (paddings, widths, sizes etc) are resized when font is resized by user. 0 means they are not changed, 1 means the same ratio as font_size/font_default_size0.4
view_source_fontFont for the "view bbcode source" modeYou can use it like "Consolas;14;bold;italic" or just "Consolas". Default font is monotype OS Dependent (Consolas or Menlo)OS depe...
text_colorOverrides text_color from the theme (added for simplicity)Normally text_color is set via the theme or using style="text_color: #color"empty
font_weight"bold" or "normal" (added to mimic TEXT behaviour)empty
font_style"italic" or "normal" (added to mimic TEXT behaviour)empty
Related to editing
editEnable or disable editingWhen editing mode is enabled, selection is also enabledfalse
selectEnable or disable selectionWhen editing is enabled, selection is also enabledfalse
string_update_modewhen to update original string (while editing)If "never" - original string is never updated, "always" - updated on every keypress, "lazy" - updated in pauses while typing (when cursor blinks), "enter" - updated on hitting "Enter". String is also updated when textwidget loses focus.lazy
max_lengthMaximum length in characters for the text content (not counting bbcode tags)Can be used to limit text input-1
allowed_charsList of characters that can be used for text inputCan limit some input fields for entering just numbers, for example numbers: allowed_chars="1234567890-+e,.%"empty
max_undo_statesSupported depth of undoSmaller values saves memory10
word_separatorsA built-in list of characters considered as word-separators (for editing/selection)Long list of charaters like ./\\()\'-:,.;>~!@#$%^*+=[]{}`~?<&\"\n\t\rsee des...
word_separators_excludeHere you can add some characters you don't want to be word-separatorsempty
cursor_pos_after_updateWhen string is updated externally, move cursor to start/end of the text.empty
Decorations and controls
themeName of the theme to use ("dark", "light" or user custom). See Themes.empty
theme_restyleTheme attributes to override (for use with DEFINE). See Themes.empty
styleTheme attributes to override (for use with particular widget). See Themes.empty
border_widthSize of the border in pixels.If set to 0, border is invisible0
scrollbars_modeHow to display vertical;horizontal scrollbars (never, always, auto, no_collapse)Modes "auto" and "no_collapse" both show and hide scrollbars on demand, but 'auto' also collapses scrollbar area when scrollbar is not needed (so there's more area for content); "never" and "always" are self-explanatory. If can set one mode for both scrollbars, or separately for vertical;horizontal - "no_collapse;never"auto
scrollbars_widthSize of scrollbars (in pixels)If you want to hide/disable scrollbars use scrollbars_mode8
vertical_resizer_widthWidth of the vertical resizer handle (if visible)This handle is displayed when resize="vertical". The drag area is slightly larger then the handle itself.60
vertical_resizer_heightHeight of the vertical resizer handle (if visible)This handle is displayed when resize="vertical". The drag area is slightly larger then the handle itself.5
corner_resizer_sizeSze of the bottom-right corner resizer (if visible)This handle is displayed when resize="both" or "horizontal"20
line_numbersDisplay line numbers (on the left side)Line numbers look can be customized using Themes.false
line_num_min_widthMinimal width of the line numbers columnThe width is auto-adjusted to match the width of the max line number.6
line_num_startFrom which number to start lines numeration1
lines_as_splitDIsplay line numbers and stripe for each visible lineBy default lines are numbered by original text lines, not as they are currently split on screen. But this mode is useful for debugging, etc.false
line_stripesDisplay line stripes ("zebra"-background under lines)Can be helpful for debugging or easier line identification. Also can show background under "active" line (also see theme's 'text_active_color'). Can be customized using Themes.false
Miscellaneous
multilineEnable or disable multiline modeIf "false", then textwidget can be used in single-line inputs etc. Newlines are converted to spaces, and hitting enter doesn't add new lines.true
resizeEnable or disable resizingDepending on resize mode bottom handle or bottom-right handle appears. User can right-click resize handle to return to default width and height |vertical
dimensions_persistentAre width and height remembered after resizeUser can right-click resize handle to return to default width and heightfalse
Exposed: yesscrollposVertical scroll positionRelative values from 0 (top) to 1 (bottom)0
Exposed: yesscrollpos_xHorizontal scroll positionRelative values from 0 (left) to 1 (right)0
scrollpos_fixedFix vertical scroll position (disable vertical scrolling)false
scrollpos_x_fixedFix horizontal scroll position (disable horizontal scrolling)false
bufferedEnable or disable buffering for CANVASWhen enabled the CANVAS element uses buffering, which saves CPU in cost of RAMtrue
right_click_scriptScript executed on right-click. Overrides the default behavior.When this is defined, the default right-click menus are disabled. If you want to simply remove right-click menu you can add some simple script here, like "int d=1;"empty
open_as_file_appWhich application to use for "Open as file" actionThis is OS dependent, use with caution. If not set, the default app for ".txt" files is used.empty
unselect_on_blurIf text was selected, forget selection on losing focusfalse
requiresExposes required objects (for scripting).Added just for convenience. What you put in "requires" goes into EXPOSED_OBJECTSempty
cursorWhich cursor to use (if not empty)empty
optionsVarious options for tweaking TW behaviourAvailable options: log_append_mode; disable_partial_resplit; disable_bbcode_toggleempty
options_defThe same as options, but with a lower priority (for DEFINES)empty
base_dirBase location for imagesImages with relative path are also searched in KUIML_DIR (for LM Skin) and SCRIPT_DATA_PATH (for Plug'n Script default skin)$_DIR_$
Pre-parsing and BBCode
trim_spacesTrim leading/trailing spaces at start/end of lineleading...
replace_rn_to_nReplace "\r\n" to simple "\n"true
strip_commentsStrip /* comments like this */ in texttrue
max_chars_in_lineLimit number of characters in lineCan be sometimes useful with monotype fonts. Disabled when 0 or auto.auto
word_wrap_by_charsWhich characters to look for when splitting string" \r"
Exposed: temporarily switch bbcode on and offbbcodeEnable or disable bbcode. See BBCode.false
copy_with_bbcodeEnable or disable copying with bbcodeYou can hold "Shift" while copying to override thisfalse
paste_with_bbcodeEnable or disable pasting with bbcodeYou can hold "Shift" while pasting to override thisfalse
bbcode_default_defsDefinitions of default bbcode complex tags (like h1, h2, list, hr...)More info in the bbcode articleSee bbc...
bbcode_defsHere you can add your own complex tags and override defaultsLike this [#h1=size=150%]. More info in the bbcode article
parse_tablesEnable or disable parsing tablesWhen enabled, every line that has "\t" characters is considered a table line, \t divides it into columns. More info in the bbcode articletrue
modify_tablesEnable or disable editing tables structureWhen enabled, used can add/remove rows via right-click menufalse
Using with param_id
contentString with param fields (to format output)Available fields: {value}, {unit}, {name}, {default}, {min}, {max}, {text_value}. {as_string}{as_str...
value_formatFormat of the 'value' fieldThe default format shows the value with one character for the decimal part, and positive values start with a blankempty
value_suffixAdd a suffix for big and small values (10000 => 10k)If the value is too small or too big, the system will use a suffix for the value, such as 'k' for kilo, 'M' for Mega, or 'm' for 'milli'false
significant_digitsNumber of significant digits to display, forcing the system to perform roundingWith significant_digits set to 2, "45678" will be displayed as 46000, and "0.654" will be displayed as 0.65. Set this parameter to 0 to disable rounding0
Events handling
eventName of the last fired eventCurrently implemented events: "keypress|Enter", "keypress|CTRL+S" and events from "action" or "a" bbcode tagsempty
events_counterEvent tracker - increments every time event is fired0
Name Value type Default Description Comment
ididentifierIdentifier of the elementIf id is given, it is used for the main WIDGET of TextWidget, so that you can access exposed WIDGET attributes, as well as some other TextWidget exposed attributes. The id of an element has to be globally unique. If you don't specify the id it'll be auto-generated.
textstringemptyStatic text to display (also can use 'value' for compatibilty with TEXT)When the string_id or param_id attribute is used, this attribute is not taken into account
string_idstring idemptyString id to display/editOverrides 'text' if set
param_idparam idemptyParameter id to display/editOverrides 'text' and 'string_id' if set
Size and position
Exposed: v. 1.9.1 (pixels)widthnumber of pixels or percentageemptydefault width in pixels / relative in percentage / auto (or empty)If TextWidget is resizable this is a default (starting) value. If set in percentage, then horizontal resizing is disabled. If is empty or "auto" then width is auto-calculated from content width (considering min/max_width).
Exposed: v. 2.0min_widthnumber of pixels200minimum width in pixels (for resizing)Used when resize="both" or "horizontal" and width is empty (auto) or fixed (not in percentage)
Exposed: v. 2.0max_widthnumber of pixels1000maximum width in pixels (for resizing)Used when resize="both" or "horizontal" and width is empty (auto) or fixed (not in percentage)
Exposed: v. 1.9.1 (pixels)heightnumber of pixels or percentageemptydefault width in pixels / relative in percentage / auto (or empty)If TextWidget is resizable this is a default (starting) value. If set in percentage, then vertical resizing is disabled. If is empty or "auto" then height is auto-calculated from content height (considering min/max_height)
Exposed: v. 2.0min_heightnumber of pixels30minimum height (for resizing)Used when resize="both" or "vertical" and height is empty (auto) or fixed (not in percentage)
Exposed: v. 2.0max_heightnumber of pixels750maximum height (for resizing)Used when resize="both" or "vertical" and height is empty (auto) or fixed (not in percentage)
Exposed: v. 1.5h_alignhorizontal alignmentemptyHorizontal alignment of the widget in its parent cell
Exposed: v. 1.5v_alignvertical alignmentemptyVertical alignment of the widget in its parent cell
Exposed: v. 1.5h_marginnumber of pixels2horizontal margin of the widget
Exposed: v. 1.5v_marginnumber of pixels5vertical margin of the widget
Exposed: v. 1.9.1v_offsetposition in pixels0vertical offset of the widgetUsing this property lets you move a widget without changing the layout around it. The position is relative to the parent cell
Exposed: v. 1.6visiblebooleantrueshow/hide the widget (does not impact the layout)
Exposed: v. 1.5displaybooleantrueshow/hide the widgetWhen set to false, the content of the widget is not displayed (not visible) AND is not taken into account to compute the layout (the widget is ignored)
Content positioning
h_padvalue in pixels6horizontal padding of the text contentDefines the space between text content and the edges or the content area. Can be set for left and right separately: h_pad="10;20"
v_padvalue in pixels6vertical padding of the text contentDefines the space between text content and the edges or the content area. Can be set for top and bottom separately: v_pad="5;15"
h_clipvalue in pixels0additional h-clipping of the content areacan be set for left and right separately: "10;5"
v_clipvalue in pixels0additional v-clipping of the content areacan be set for top and bottom separately: "4;6"
Exposed: yestext_h_alignleft, center, right or justifylefthorizontal text alignmentCan be further adjusted with bbcode (if enabled) using [left], [center], [right] or [justify]
Exposed: yestext_v_aligntop, center of bottomtopvertical text alignment
Font-related
font_faceFont name, bold, italicOS dependentFont name (face) with optional bold and italicYou can put 'bold' or 'italic' here as well: "Arial;bold;italic".
Default font is monotype: Consolas for Windows, Menlo for MacOS
Exposed: current font sizefont_sizesize; min; max14;6;50Font size (with optional min and max values)If you set min and max (ex. "12;8;40") values then quick font-resizing will be available using mouse (Ctrl+wheel) and keyboard Ctrl + "+" or "-".
To return to default font-size use Ctrl+click or Ctrl+"0"
font_size_persistentbooleanfalseIs font size remembered after font-resize
font_resize_follow_ratiofloat0.4How much other elements are resized on font-resizeThis determines how other elements (paddings, widths, sizes etc) are resized when font is resized by user. 0 means they are not changed, 1 means the same ratio as font_size/font_default_size
view_source_fontstringOS dependentFont for the "view bbcode source" modeYou can use it like "Consolas;14;bold;italic" or just "Consolas". Default font is monotype OS Dependent (Consolas or Menlo)
text_colorStringemptyOverrides text_color from the theme (added for simplicity)Normally text_color is set via the theme or using style="text_color: #color"
font_weightStringempty"bold" or "normal" (added to mimic TEXT behaviour)
font_styleStringempty"italic" or "normal" (added to mimic TEXT behaviour)
Related to editing
editbooleanfalseEnable or disable editingWhen editing mode is enabled, selection is also enabled
selectbooleanfalseEnable or disable selectionWhen editing is enabled, selection is also enabled
string_update_modenever, always, lazy, enterlazywhen to update original string (while editing)If "never" - original string is never updated, "always" - updated on every keypress, "lazy" - updated in pauses while typing (when cursor blinks), "enter" - updated on hitting "Enter". String is also updated when textwidget loses focus.
max_lengthint-1Maximum length in characters for the text content (not counting bbcode tags)Can be used to limit text input
allowed_charsstringemptyList of characters that can be used for text inputCan limit some input fields for entering just numbers, for example numbers: allowed_chars="1234567890-+e,.%"
max_undo_statesinteger10Supported depth of undoSmaller values saves memory
word_separatorsstringsee descriptionA built-in list of characters considered as word-separators (for editing/selection)Long list of charaters like ./\\()\'-:,.;>~!@#$%^*+=[]{}`~?<&\"\n\t\r
word_separators_excludestringemptyHere you can add some characters you don't want to be word-separators
cursor_pos_after_updatestart, end or emptyemptyWhen string is updated externally, move cursor to start/end of the text.
Decorations and controls
themestringemptyName of the theme to use ("dark", "light" or user custom). See Themes.
theme_restylestringemptyTheme attributes to override (for use with DEFINE). See Themes.
stylestringemptyTheme attributes to override (for use with particular widget). See Themes.
border_widthvalue in pixels0Size of the border in pixels.If set to 0, border is invisible
scrollbars_modenever, always, auto, no_collapseautoHow to display vertical;horizontal scrollbars (never, always, auto, no_collapse)Modes "auto" and "no_collapse" both show and hide scrollbars on demand, but 'auto' also collapses scrollbar area when scrollbar is not needed (so there's more area for content); "never" and "always" are self-explanatory. If can set one mode for both scrollbars, or separately for vertical;horizontal - "no_collapse;never"
scrollbars_widthvalue in pixels8Size of scrollbars (in pixels)If you want to hide/disable scrollbars use scrollbars_mode
vertical_resizer_widthvalue in pixels60Width of the vertical resizer handle (if visible)This handle is displayed when resize="vertical". The drag area is slightly larger then the handle itself.
vertical_resizer_heightvalue in pixels5Height of the vertical resizer handle (if visible)This handle is displayed when resize="vertical". The drag area is slightly larger then the handle itself.
corner_resizer_sizevalue in pixels20Sze of the bottom-right corner resizer (if visible)This handle is displayed when resize="both" or "horizontal"
line_numbersbooleanfalseDisplay line numbers (on the left side)Line numbers look can be customized using Themes.
line_num_min_widthvalue in pixels6Minimal width of the line numbers columnThe width is auto-adjusted to match the width of the max line number.
line_num_startinteger1From which number to start lines numeration
lines_as_splitbooleanfalseDIsplay line numbers and stripe for each visible lineBy default lines are numbered by original text lines, not as they are currently split on screen. But this mode is useful for debugging, etc.
line_stripesbooleanfalseDisplay line stripes ("zebra"-background under lines)Can be helpful for debugging or easier line identification. Also can show background under "active" line (also see theme's 'text_active_color'). Can be customized using Themes.
Miscellaneous
multilinebooleantrueEnable or disable multiline modeIf "false", then textwidget can be used in single-line inputs etc. Newlines are converted to spaces, and hitting enter doesn't add new lines.
resizevertical, horizontal, both, falseverticalEnable or disable resizingDepending on resize mode bottom handle or bottom-right handle appears. User can right-click resize handle to return to default width and height |
dimensions_persistentbooleanfalseAre width and height remembered after resizeUser can right-click resize handle to return to default width and height
Exposed: yesscrollpos0 to 10Vertical scroll positionRelative values from 0 (top) to 1 (bottom)
Exposed: yesscrollpos_x0 to 10Horizontal scroll positionRelative values from 0 (left) to 1 (right)
scrollpos_fixedbooleanfalseFix vertical scroll position (disable vertical scrolling)
scrollpos_x_fixedbooleanfalseFix horizontal scroll position (disable horizontal scrolling)
bufferedbooleantrueEnable or disable buffering for CANVASWhen enabled the CANVAS element uses buffering, which saves CPU in cost of RAM
right_click_scriptstringemptyScript executed on right-click. Overrides the default behavior.When this is defined, the default right-click menus are disabled. If you want to simply remove right-click menu you can add some simple script here, like "int d=1;"
open_as_file_appstringemptyWhich application to use for "Open as file" actionThis is OS dependent, use with caution. If not set, the default app for ".txt" files is used.
unselect_on_blurbooleanfalseIf text was selected, forget selection on losing focus
requiresstringemptyExposes required objects (for scripting).Added just for convenience. What you put in "requires" goes into EXPOSED_OBJECTS
cursorstringemptyWhich cursor to use (if not empty)
optionsstringemptyVarious options for tweaking TW behaviourAvailable options: log_append_mode; disable_partial_resplit; disable_bbcode_toggle
options_defstringemptyThe same as options, but with a lower priority (for DEFINES)
base_dirString$_DIR_$Base location for imagesImages with relative path are also searched in KUIML_DIR (for LM Skin) and SCRIPT_DATA_PATH (for Plug'n Script default skin)
Pre-parsing and BBCode
trim_spacesleading;trailingleading;trailingTrim leading/trailing spaces at start/end of line
replace_rn_to_nbooleantrueReplace "\r\n" to simple "\n"
strip_commentsbooleantrueStrip /* comments like this */ in text
max_chars_in_lineint or autoautoLimit number of characters in lineCan be sometimes useful with monotype fonts. Disabled when 0 or auto.
word_wrap_by_charsstring" \r"Which characters to look for when splitting string
Exposed: temporarily switch bbcode on and offbbcodebooleanfalseEnable or disable bbcode. See BBCode.
copy_with_bbcodebooleanfalseEnable or disable copying with bbcodeYou can hold "Shift" while copying to override this
paste_with_bbcodebooleanfalseEnable or disable pasting with bbcodeYou can hold "Shift" while pasting to override this
bbcode_default_defsstringSee bbcodeDefinitions of default bbcode complex tags (like h1, h2, list, hr...)More info in the bbcode article
bbcode_defsstringHere you can add your own complex tags and override defaultsLike this [#h1=size=150%]. More info in the bbcode article
parse_tablesbooleantrueEnable or disable parsing tablesWhen enabled, every line that has "\t" characters is considered a table line, \t divides it into columns. More info in the bbcode article
modify_tablesbooleanfalseEnable or disable editing tables structureWhen enabled, used can add/remove rows via right-click menu
Using with param_id
contentstring{as_string}String with param fields (to format output)Available fields: {value}, {unit}, {name}, {default}, {min}, {max}, {text_value}. {as_string}
value_formatparam value formattingemptyFormat of the 'value' fieldThe default format shows the value with one character for the decimal part, and positive values start with a blank
value_suffixbooleanfalseAdd a suffix for big and small values (10000 => 10k)If the value is too small or too big, the system will use a suffix for the value, such as 'k' for kilo, 'M' for Mega, or 'm' for 'milli'
significant_digitspositive integer value0Number of significant digits to display, forcing the system to perform roundingWith significant_digits set to 2, "45678" will be displayed as 46000, and "0.654" will be displayed as 0.65. Set this parameter to 0 to disable rounding
Events handling
eventStringemptyName of the last fired eventCurrently implemented events: "keypress|Enter", "keypress|CTRL+S" and events from "action" or "a" bbcode tags
events_counterinteger0Event tracker - increments every time event is fired

Comments

Please, authorize to view and post comments.

2020 - 2026 © Site by LetiMix · Donate  |  Plug'n Script and KUIML by Blue Cat Audio