>  Docs Center  >  ENVI API  >  ENVI Classic Display  >  WIDGET_STRING



This function returns a compound widget used to enter a string, and it returns the base ID of the widget. An interactive ENVI Classic session is required to run this function.


Result = WIDGET_STRING(Base [, /ALL_EVENTS] [, /AUTO_MANAGE] [, DEFAULT=string] [, PROMPT=string], UVALUE=value [, XSIZE=value])



This is the ID of the base widget.


ALL_EVENTS (optional)

Set this keyword to specify that the widget generate an event for all supported events.

AUTO_MANAGE (optional)

Set this keyword to specify that the widget be managed by the ENVI Classic function AUTO_WID_MNG.

DEFAULT (optional)

Use this keyword to specify a default string.

PROMPT (optional)

Use this keyword to specify the prompt string to be used for the widget.


Use this keyword to assign a “user value” to the widget. This value may be of any data type and organization. The user value exists entirely for your convenience. For widgets managed by the ENVI Classic function AUTO_WID_MNG, UVALUE is a tag name in the returned anonymous structure. For user-managed widgets, you can set and use UVALUE however you wish. You must set UVALUE for all compound widgets.

XSIZE (optional)

Use this keyword to specify the width of the widget, in characters.

Widget Event

When the widget is not auto-managed, widget events set event.result to the entered string.


Create a simple compound widget to enter a string value. Print this string.

  base = widget_auto_base(title='Edit String')
  ws = widget_string(base, uvalue='str', /auto)
  result = auto_wid_mng(base)
  if (result.accept eq 0) then return
  print, 'New String ', result.str

API Version


© 2020 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us