The DtEditor widget provides the following set of resources.
DtNautoShowCursorPosition ensures that the text visible in the scrolled edit window contains the insert cursor when set to True. If the insert cursor changes, the contents of the editor may scroll to bring the insertion point into the window.
DtNblinkRate specifies the blink rate of the text cursor in milliseconds. The time it takes to blink the insertion cursor on and off is twice the blink rate. When the blink rate is set to zero, the cursor does not blink. The value must not be negative.
DtNbuttonFontList specifies the font list used for the buttons that are displayed in the dialog boxes of DtEditor.
DtNcolumns specifies the initial width of the editor as an integer number of characters. The value must be greater than zero.
DtNcursorPosition specifies the location of the current insert cursor in the editor where the current insert cursor is placed. Position is determined by the number of characters from the beginning of the text. The first character position is 0.
DtNcursorPositionVisible marks the insert cursor position by a blinking text cursor when the Boolean value is True.
DtNdialogTitle specifies the title for all dialogs displayed by DtEditor. These include the dialogs for word search and replace, misspelled words, and format settings.
DtNeditable indicates that the user can edit the data when set to True. Prohibits the user from editing data when set to False.
DtNlabelFontList specifies the font list used for DtEditor labels (the labels are displayed in the status line and DtEditor dialog boxes).
DtNoverstrike when set to False, characters typed into the editor widget inserts at the position of the cursor (the default). When set to True, characters typed into the editor widget replace the characters that directly follow the insertion cursor. When the end of the line is reached, characters are appended to the end of the line. If the status line is visible, the DtNoverstrikeIndicatorLabel is displayed in the status line whenever DtNoverstrike is True.
DtNrows specifies the initial height of the editor measured in character heights. The value must be greater than zero.
DtNscrollHorizontal adds a scroll bar that enables the user to scroll horizontally through text when the Boolean value is True.
DtNscrollLeftSide puts a vertical scroll bar on the left side of the scrolled edit window when the Boolean value is True.
DtNshowStatusLine displays a status line below the text window when set to True. The status line contains a field that displays the current line number of the insert cursor, total number of lines in the document, and whether the editor is in overstrike mode. Users can type a line number in the line number display to go directly to that line.
The status line also includes a Motif XmTextField(3X) widget for displaying messages supplied by an application. This field is a convenient place for an application to display status and feedback about the document being edited. The ID of the text field is retrieved using DtEditorGetMessageTextFieldID(3). A message is displayed by setting the XmNvalue or XmNvalueWcs resource of this widget. If the text field is not needed, you can unmanage it by calling XtUnmanageWidget(3X) with its ID.
DtNspellFilter specifies the filter used to identify spelling errors. The function DtEditorInvokeSpellDialog(3) filters the contents of an editor through the filter specified by DtNspellFilter. The filter specified should accept a file name and produce a list of misspelled and unrecognized words in this file on stdout. The default filter is spell(1).
DtNtextBackground specifies the background for the edit window.
DtNtextDeselectCallback specifies a function called whenever no text is selected within the edit area. The reason sent by the callback is DtEDITOR_TEXT_DESELECT.
DtNtextFontList specifies the font list used for the DtEditor edit window and its text fields. The text fields are displayed in the status line and DtEditor dialog boxes.
DtNtextForeground specifies the foreground for the edit window.
DtNtextSelectCallback specifies a function called whenever text is selected within the edit area. The reason sent by the callback is DtEDITOR_TEXT_SELECT.
DtNtextTranslations specifies translations that are added to the edit window. Translations specified with this resource override any duplicate translations defined for the edit window. See the DtEditor(3) man page for a list of translations provided by DtEditor.
DtNtopCharacter displays the line that contains the position of text at the top of the scrolled edit window. The line is displayed at the top of the widget without shifting the text left or right. Position is determined by the number of characters from the beginning of the text. The first character position is zero.
XGetValues(3X) for DtNtopCharacter returns the position of the first character in the line that is displayed at the top of the widget.
DtNwordWrap breaks lines at word breaks with soft carriage returns when they reach the right edge of the window. Note that word wrap affects only the visual appearance of the contents of an editor widget. The line breaks (soft carriage returns) are not physically inserted into the text. The editor does support substituting hard carriage returns when the contents of the widget are retrieved or saved to a file. See the DtEditorGetContents(3) and DtEditorSaveContentsToFile(3) man pages for more information.
Table 7-9 lists the class, type, default, and access for each resource. You can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or class in an .Xdefaults file, remove the DtN or DtC prefix and use the remaining letters. To specify one of the defined values for a resource in an .Xdefaults file, remove the Dt prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words).
The codes in the access column show if you can:
Set the resource at creation time (C)
Set by using XtSetValues (S)
Retrieve by using XtGetValues (G)
See the DtEditor(3) man page for more information.
Table 7-9 DtEditor Resources
Name |
Class |
Type |
Default |
Access |
---|---|---|---|---|
DtNautoShowCursorPosition |
DtCAutoShowCursorPosition |
Boolean |
True |
CSG |
DtNblinkRate |
DtCBlinkRate |
int |
500 |
CSG |
DtNbuttonFontList |
DtCFontList |
XmFontList |
Dynamic |
CSG |
DtNcolumns |
DtCColumns |
XmNcolumns |
Dynamic |
CSG |
DtNcursorPosition |
DtCCursorPosition |
XmTextPosition |
0 |
CSG |
DtNcursorPositionVisible |
DtCCursorPositionVisible |
Boolean |
True |
CSG |
DtNdialogTitle |
DtCDialogTitle |
XmString |
NULL |
CSG |
DtNeditable |
DtCEditable |
Boolean |
True |
CSG |
DtNlabelFontList |
DtCFontList |
XmFontList |
Dynamic |
CSG |
DtNmaxLength |
DtCMaxLength |
int |
Largest integer |
CSG |
DtNoverstrike |
DtCOverstrike |
Boolean |
False |
CSG |
DtNrows |
DtCRows |
XmNrows |
Dynamic |
CSG |
DtNscrollHorizontal |
DtCScroll |
Boolean |
True |
CG |
DtNscrollLeftSide |
DtCScrollSide |
Boolean |
Dynamic |
CG |
DtNscrollTopSide |
DtCScrollSide |
Boolean |
False |
CG |
DtNscrollVertical |
DtCScroll |
Boolean |
True |
CG |
DtNshowStatusLine |
DtCShowStatusLine |
Boolean |
False |
CSG |
DtNspellFilter |
DtCspellFilter |
char * |
Spell |
CSG |
DtNtextBackground |
DtCBackground |
Pixel |
Dynamic |
CSG |
DtNtextDeselectCallback |
DtCCallback |
XtCallbackList |
NULL |
C |
DtNtextFontList |
DtCFontList |
XmFontList |
Dynamic |
CSG |
DtNtextForeground |
DtCForeground |
Pixel |
Dynamic |
CSG |
DtNtextTranslations |
DtCTranslations |
XtTranslations |
NULL |
CS |
DtNtextSelectCallback |
DtCCallback |
XtCallbackList |
NULL |
C |
DtNtopCharacter |
DtCTextPosition |
XmTextPosition |
0 |
CSG |
DtNwordWrap |
DtCWordWrap |
Boolean |
True |
CSG |