The XDISPLAYFILE procedure is a utility for displaying ASCII text files using a widget interface.
This routine is written in the IDL language. Its source code can be found in the file
xdisplayfile.pro in the
lib/utilities subdirectory of the IDL distribution.
XDISPLAYFILE, Filename [, /BLOCK] [, DONE_BUTTON=string] [, /EDITABLE] [, FONT=string] [, GROUP=widget_id] [, HEIGHT=lines] [, /MODAL] [, TEXT=string or string array] [, TITLE=string] [, WIDTH=characters] [, WTEXT=variable]
A scalar string that contains the filename of the file to display. Filename can include a path to that file.
Set this keyword to have XMANAGER block when this application is registered. By default, BLOCK is set equal to zero, providing access to the command line if active command line processing is available. Note that setting BLOCK=1 will cause all widget applications to block, not just this application. For more information, see the documentation for the NO_BLOCK keyword to XMANAGER.
Set this keyword to a string containing the text to use for the Done button label. If omitted, the text "Done with <filename>" is used.
Set this keyword to allow modifications to the text displayed in XDISPLAYFILE. Setting this keyword also adds a "Save" button in addition to the Done button.
A string containing the name of the font to use. The font specified is a device font (an X Windows font on Motif systems; a TrueType or PostScript font on Windows systems). See About Device Fonts for details on specifying names for device fonts. If this keyword is omitted, the default font is used.
The widget ID of the widget that calls XDISPLAYFILE. If this keyword is specified, the death of the group leader results in the death of XDISPLAYFILE.
The number of text lines that the widget should display at one time. If this keyword is not specified, 24 lines is the default.
Set this keyword to create the XDISPLAYFILE dialog as a modal dialog. Setting the MODAL keyword allows you to call XDISPLAYFILE from another modal dialog.
A string or string array to be displayed in the widget instead of the contents of a file. If this keyword is present, the Filename input argument is ignored (but is still required). String arrays are displayed one element per line.
A string to use as the widget title rather than the file name or "XDisplayFile".
The width of the widget display in characters. If this keyword is not specified, 80 characters is the default.
Set this keyword to a named variable that will contain the widget ID of the text widget. This allows setting text selections and cursor positions programmatically. For example, the following code opens the XDISPLAYFILE widget and selects the first 10 characters of the file displayed in the text widget:
XDISPLAYFILE, 'myfile.txt', /EDITABLE, WTEXT=w WIDGET_CONTROL, w, SET_TEXT_SELECT=[0, 10]
Introduced: Pre 4.0