DTEDITOR(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

πŸ’… NAME πŸ’…

Okay bestie, welcome to the DtEditor(library call) page β€” this is all about DtEditor, the DtEditor widget class. Periodt. πŸ‘‘

✨ SYNOPSIS ✨

#include &<Dt/Editor.h>

πŸ¦‹ DESCRIPTION πŸ¦‹

The DtEditor widget is literally the moment for creating and editing text files. It gives apps running in the desktop environment a consistent way to edit text data β€” same vibe everywhere, no chaos. The widget is made up of:

  • A scrolled edit window for text
  • Dialogs for finding and changing text
  • An optional status line
  • A spell checking option
  • Formatting options
  • Convenience functions for programmatically controlling the widget

It supports these basic editing operations:

  • Finding and changing text
  • Simple formatting
  • Spell checking
  • Undoing the previous edit operation

All of these operations β€” except spell checking β€” support locales with single-byte and multi-byte characters. No cap. 🌈

The DtEditor widget also supports input and output of ASCII text, multi-byte text, and buffers of data. Data can go between the application and the DtEditor widget, or between a file and the widget. It's giving very flexible. 🫢

It also has separate callback lists to track when text is selected or deselected. And it extends the standard help callback so help requests from any of its components get reported. Iconic behavior. ✨

Important bestie: widget subclassing is not supported for the DtEditor widget class. That's a no. πŸ™ˆ

πŸŽ€ Edit Window πŸŽ€

The edit window supports basic editing operations like cut and paste, find and change, simple formatting, and spell checking. It's the main character of this whole situation, honestly. πŸ’–

🐭 Mouse and Keyboard 🐭

The user can use the mouse to move the edit cursor and to select portions of a document for editing operations. Selection is based on the model specified in the Inter-Client Communication Conventions Manual (ICCCM). The DtEditor widget supports primary and secondary selection. Very official, very slay. πŸ’…

The user can cut, copy, and paste text using the clipboard, primary transfer, or secondary transfer. The DtEditor widget accepts drops of text, text files, or buffers of data. Text drops get inserted where the mouse button is released to complete the drop. Dropped files and buffers of data are placed at the insertion cursor. The DtEditor widget also supports dragging of text within the edit window or to a different widget. Drag and drop ate, fr fr. πŸ“

The DtEditor widget provides a set of translations for the edit window. The default translations provide key bindings for moving the insertion cursor, and deleting, inserting, and selecting text. The insertion cursor β€” displayed as an I-beam β€” shows where input is inserted. Input is inserted just before the insertion cursor. Very demure, very mindful. πŸŽ€

🌸 Status Line 🌸

The status line can be shown or hidden, and it displays the current line number, total line count, and whether the DtEditor widget is in overstrike mode. The current line-number display shows the line number of the line containing the insertion cursor. The user can go directly to any line in the document by entering the number into the current line number display. The status line also provides a text field for displaying application-supplied messages. For info on localizing the status line, see the Localization Resources section. Cute and useful? We love to see it. πŸ’œ

🧚 Dialogs 🧚

The DtEditor widget includes dialogs that give a graphical user interface to its functionality:

  • Find/Change dialog
  • Spell dialog.
  • Format Settings dialog

The titles of all dialogs are controlled with the DtNdialogTitle resource. All dialogs are posted using corresponding convenience functions and remain posted until dismissed by the user. Each dialog includes Close and Help buttons in addition to the buttons described in the following lists. For info on localizing these dialogs, see the Localization Resources section. πŸŽ€

The Find/Change dialog for the DtEditor widget lets users search for β€” and optionally replace β€” a string in the edit window. The dialog includes fields for specifying the find string and the replacement string. Buttons initiate the find or change either the next occurrence or all occurrences of the find string to the replacement string. When the user selects the Find button, the next occurrence of the specified string (regular expressions are not supported) is highlighted in the DtEditor widget, if found; otherwise, the DtEditor widget displays a message dialog stating the string was not found. If the string was found, the user has the option to change the highlighted occurrence or all occurrences. Big find-and-change energy. πŸ”₯

The DtEditorFind(3) and DtEditorChange(3) functions provide a programmatic interface to the find and change functionality of the DtEditor widget. Love a convenient function. πŸ’…

The Spell dialog is used to check the contents of the edit window for spelling errors. It consists of a list of misspelled words, a replacement string field, and the same set of buttons as the Find dialog. Choosing a word from the list automatically selects it as the find string. Double-clicking on a word searches for the next occurrence of that word. The list of misspelled words is automatically generated using the filter specified by DtNspellFilter when the dialog is displayed. The actions for find, change to, and change all are the same as the Find dialog. Spell check said "not today, bestie." 😭

The Format Settings dialog for the DtEditor widget lets users format the contents of the edit window, format just the paragraph containing the insertion cursor, or specify the arguments used when formatting text. The arguments include margin settings and text alignment. The user has the choice of aligning the text flush with the left or right margin, centering each line of text between the margins, or aligning it flush with both margins. The user enters the left and right margin values into text fields and chooses an alignment option from a set of toggle buttons. Two push buttons allow them to format the current paragraph or format the complete document. Formatting? We're obsessed. ✨

The margin values used for formatting do not have to be the same as the width of the edit window. It is possible to format the text with margin values that are narrower or wider than the displayed edit window. By default, values for the format margins are the current size of the edit window. If text is formatted wider than the edit window and the DtNwordWrap resource is True, text wraps at the right edge of the edit window (see the description for DtNwordWrap), regardless of the right margin setting. To format text wider than the edit window, DtNwordWrap should be False. Read that twice, bestie β€” it matters. 🫢

The DtEditorFormat(3) function provides a programmatic interface to the format functionality of the DtEditor widget. Slay. πŸ’…

🌈 Word Wrap and Formatting 🌈

Word wrap and text formatting are essentially independent operations. Word wrap is about the dynamic display of lines β€” as delimited by <newline> characters β€” that exceed the width of the Text Editor window, and it's based on the left and right window boundaries. When word wrap mode is off (the default), each line of text is displayed on a single line on the display, and text entered at the right window boundary causes the window to scroll automatically to the right to accommodate the new text until an actual <newline> character is entered (normally, by pressing the Return key). When word wrap mode is on, lines longer than the window width are automatically wrapped at the right window margin to one or more display lines, and text entered at the right window boundary is automatically broken on a word boundary to the first column of the next display line. Word wrap is dynamic in that word-wrapped lines are automatically adjusted when text is inserted or deleted or when the window is resized. Word wrap only affects the display of lines; it does not actually insert <newline> characters in the text. No sneaky newline behavior. πŸ’€

Text formatting is a static operation that inserts actual <newline> (and/or <space>) characters directly in the text to match it to the left and right margins (and justification mode) specified in the Format Settings dialog. Format settings affect text only when explicitly applied and have no affect on word wrap or previously formatted text. Initially, and whenever the window is resized, the right format margin is automatically set to the window width to match the word wrap boundary. That's the whole vibe check. βœ…

πŸ‘‘ Classes πŸ‘‘

The DtEditor widget inherits behavior and resources from Core, Composite, Constraint, XmManager, XmBulletinBoard, and XmForm classes. Bloodline! πŸ‘‘

The class pointer is dtEditorWidgetClass.

The class name is DtEditorWidget.

πŸ†• New Resources πŸ†•

Okay bestie, so this part is all about the resources the application uses to tell the widget what data to show. The application can also set resource values on the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, you have to remove the DtN or DtC prefix and use the remaining letters. To set one of the defined values for a resource in a .Xdefaults file, remove the Dt prefix and use the remaining letters β€” lower case or upper case is fine, but keep any underscores between words. The codes in the access column mean: set at creation time (C), set with XtSetValues (S), retrieved with XtGetValues (G), or not applicable (N/A).

🌸 DtEditor Resource Set 🌸

The original puts this in a table, but tables are not the vibe here, so here's every single one with all its fields, no cap:

  • DtNautoShowCursorPosition β€” class DtCAutoShowCursorPosition, type Boolean, default True, access CSG
  • DtNblinkRate β€” class DtCBlinkRate, type int, default 500, access CSG
  • DtNbuttonFontList β€” class DtCFontList, type XmFontList, default dynamic, access CSG
  • DtNcolumns β€” class DtCColumns, type XmNcolumns, default dynamic, access CSG
  • DtNcursorPosition β€” class DtCCursorPosition, type XmTextPosition, default 0, access CSG
  • DtNcursorPositionVisible β€” class DtCCursorPositionVisible, type Boolean, default True, access CSG
  • DtNdialogTitle β€” class DtCDialogTitle, type XmString, default NULL, access CSG
  • DtNeditable β€” class DtCEditable, type Boolean, default True, access CSG
  • DtNlabelFontList β€” class DtCFontList, type XmFontList, default dynamic, access CSG
  • DtNmaxLength β€” class DtCMaxLength, type int, default largest integer, access CSG
  • DtNoverstrike β€” class DtCOverstrike, type Boolean, default False, access CSG
  • DtNrows β€” class DtCRows, type XmNrows, default dynamic, access CSG
  • DtNscrollHorizontal β€” class DtCScroll, type Boolean, default True, access CG
  • DtNscrollLeftSide β€” class DtCScrollSide, type Boolean, default dynamic, access CG
  • DtNscrollTopSide β€” class DtCScrollSide, type Boolean, default False, access CG
  • DtNscrollVertical β€” class DtCScroll, type Boolean, default True, access CG
  • DtNshowStatusLine β€” class DtCShowStatusLine, type Boolean, default False, access CSG
  • DtNspellFilter β€” class DtCspellFilter, type char *, default spell, access CSG
  • DtNtextBackground β€” class DtCBackground, type Pixel, default dynamic, access CSG
  • DtNtextDeselectCallback β€” class DtCCallback, type XtCallbackList, default NULL, access C
  • DtNtextFontList β€” class DtCFontList, type XmFontList, default dynamic, access CSG
  • DtNtextForeground β€” class DtCForeground, type Pixel, default dynamic, access CSG
  • DtNtextSelectCallback β€” class DtCCallback, type XtCallbackList, default NULL, access C
  • DtNtextTranslations β€” class DtCTranslations, type XtTranslations, default NULL, access CS
  • DtNtopCharacter β€” class DtCTextPosition, type XmTextPosition, default 0, access CSG
  • DtNwordWrap β€” class DtCWordWrap, type Boolean, default False, access CSG
Tiny stray artifact from the original table markup, preserved exactly because rules are rules: tgroup dispwid="7.87in"Caret

DtNautoShowCursorPosition β€” When set to True, this makes sure the text visible in the scrolled edit window contains the insert cursor. If the insert cursor changes, the contents of the DtEditor widget may scroll so the insertion point gets brought into the window. Iconic behavior, honestly.

DtNblinkRate β€” Specifies the blink rate of the text cursor in milliseconds. The time in the blink rate relates to the time the cursor is visible and the time the cursor is invisible β€” that is, the time it takes to blink the insertion cursor on and off is twice the blink rate. The cursor does not blink when the blink rate is set to zero. The value cannot be negative.

DtNbuttonFontList β€” Specifies the font list used for the DtEditor buttons (the buttons appearing in the DtEditor dialogs). If this value is NULL at initialization, it gets initialized by looking up the parent hierarchy of the widget for an ancestor that is a subclass of the XmBulletinBoard, VendorShell, or XmMenuShell widget class. If such an ancestor is found, the font list is initialized to the appropriate default font list of the ancestor widget (XmNdefaultFontList for VendorShell and XmMenuShell, and XmNbuttonFontList for XmBulletinBoard). If no such ancestor is found, the default is implementation dependent. Refer to XmFontList(3) for more on the creation and structure of a font list.

DtNcolumns β€” Specifies the initial width of the edit window of the DtEditor widget as an integral number of characters. The width equals the number of characters this resource specifies multiplied by the maximum character width of the associated font. For proportionate fonts, the actual number of characters that fit on a given line may be greater than the value specified. The value must be greater than zero. The default value depends on the value of the DtNwidth resource. Slay.

DtNcursorPosition β€” Indicates the position in the DtEditor widget where the current insert cursor is located. This position is determined by the number of characters from the beginning of the text. The first character position is zero.

DtNcursorPositionVisible β€” When set to True, this resource specifies that the insert cursor position is marked by a blinking text cursor. Blink blink, bestie.

DtNdialogTitle β€” Specifies an XmString that appears as part of the titles for the dialogs displayed by the DtEditor widget. If this resource is non-NULL, it is used as the prefix of the titles for the Find/Change, Spell and Format Settings dialogs.

DtNeditable β€” When set to True, this resource indicates that the user can edit the text; otherwise, it prohibits the user from editing the text. No unauthorized edits, periodt.

DtNlabelFontList β€” Specifies the font list used for the labels for DtEditor (the labels appear in the status line and the DtEditor dialogs). If this value is NULL at initialization, it is initialized by looking up the parent hierarchy of the widget for an ancestor that is a subclass of the XmBulletinBoard, VendorShell, or XmMenuShell widget class. If such an ancestor is found, the font list is initialized to the XmNlabelFontList of the ancestor widget. If no such ancestor is found, the default is implementation dependent. Refer to XmFontList(3) for more information on the creation and structure of a font list.

DtNmaxLength β€” Specifies the maximum length of the text string that can be entered into the DtEditor widget from the keyboard. This value must be non-negative. Strings entered using the DtEditorSetContents(3) or DtEditorSetContentsFromFile(3) functions ignore this resource. Sneaky but valid.

DtNoverstrike β€” When set to False, characters typed into the DtEditor widget are inserted at the position of the insertion cursor. This is the default behavior. If set to True, characters typed into the DtEditor 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, DtNoverstrikeIndicatorLabel appears in the status line whenever DtNoverstrike is True.

DtNrows β€” Specifies the initial height of the edit window of the DtEditor widget measured in character heights. The value must be greater than zero.

DtNscrollHorizontal β€” When set to True, this resource adds a ScrollBar that allows the user to scroll horizontally through text.

DtNscrollLeftSide β€” When set to True, this resource indicates that the vertical ScrollBar should be placed on the left side of the scrolled edit window. This attribute is ignored if DtNscrollVertical is False. The default value may depend on the value of the XmNstringDirection resource.

DtNscrollTopSide β€” When set to True, this resource indicates that the horizontal ScrollBar should be placed on the top side of the scrolled edit window. This attribute is ignored if DtNscrollHorizontal is False.

DtNscrollVertical β€” When set to True, this resource adds a ScrollBar that allows the user to scroll vertically through text.

DtNshowStatusLine β€” When set to True, the DtEditor widget displays a status line below the edit window. 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 DtEditor widget is in overstrike mode. The user can enter a line number in the line number display to go directly to that line.

The status line also includes a Motif Text Field widget (XmTextField) for displaying application supplied messages. This field is a convenient way for an application to display status and feedback about the document being edited. The Text Field ID 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, it can be unmanaged by calling XtUnmanageWidget(3) with its ID. So useful, honestly.

DtNspellFilter β€” Specifies the filter used to identify spelling errors. The DtEditorInvokeSpellDialog(3) function filters the contents of a DtEditor widget 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 standard out. The default filter is spell(1). Spelling tea served hot.

DtNtextBackground β€” Specifies the background of the edit window and the text fields for DtEditor (the text fields appear in the status line and DtEditor dialogs). Aesthetic details matter, bestie.

  • DtNtextDeselectCallback β€” the function that gets called any time the selection becomes NULL, aka nothing is selected in the edit area anymore. The reason the callback gets sent is DtEDITOR_TEXT_DESELECT. Bye-bye highlight 🫢
  • DtNtextFontList β€” the font list used for the edit window and the text fields for DtEditor (those text fields live in the status line and in DtEditor dialogs). If this is NULL at initialization, it gets initialized by walking up the parent hierarchy of the widget looking for an ancestor that's a subclass of the XmBulletinBoard or VendorShell widget class. Find one? Font list gets initialized to that ancestor's XmNtextFontList. Find nothing? Default is implementation dependent, bestie, it's giving "mystery". Peep XmFontList(3) for the whole creation + structure situation. ✨
  • DtNtextForeground β€” foreground color of the edit window and the text fields for DtEditor (yep, the ones in the status line and dialogs).
  • DtNtextSelectCallback β€” the function called whenever the selection becomes non-NULL, aka some text actually got selected in the edit area. Reason sent by the callback: DtEDITOR_TEXT_SELECT. πŸŽ€
  • DtNtextTranslations β€” adds translations to the edit window. Anything you set here overrides duplicate translations already defined for the edit window. No cap, yours wins. πŸ‘‘
  • DtNtopCharacter β€” displays the line containing the position of text at the top of the scrolled edit window. That line shows up at the top of the DtEditor widget without shifting the text left or right. Position = number of characters from the beginning of the text, and the first character position is zero. Fancy. If you XtGetValues(3) for DtNtopCharacter, you get back the position of the first character in the line displayed at the top of the DtEditor widget.
  • DtNwordWrap β€” says text should not go off the right edge of the window; instead lines break at word breaks with soft line feeds when they hit the right edge. Important vibe check: word wrap only affects the visual appearance of the contents of a DtEditor widget. The line breaks (those soft line feeds) are not physically inserted into the text. And yes, the DtEditor widget supports substituting <newline>s when the contents are retrieved or saved to a file β€” see DtEditorGetContents(3) and DtEditorSaveContentsToFile(3). πŸ’…

🌍 Localization Resources 🌍

The following table defines a set of widget resources designed for localization of the DtEditor widget and its dialogs. Default values for these resources depend on the locale. πŸ¦‹

DtEditor Localization Resource Set

Every single one of these is Type XmString, Default Dynamic, Access CSG β€” so I'm listing them with their Name and Class, and the boring columns are the same across the board, periodt:

  • DtNcenterToggleLabel β€” Class DtCCenterToggleLabel, Type XmString, Default Dynamic, Access CSG
  • DtNchangeAllButtonLabel β€” Class DtCChangeAllButtonLabel, Type XmString, Default Dynamic, Access CSG
  • DtNchangeButtonLabel β€” Class DtCChangeButtonLabel, Type XmString, Default Dynamic, Access CSG
  • DtNchangeFieldLabel β€” Class DtCChangeFieldLabel, Type XmString, Default Dynamic, Access CSG
  • DtNcurrentLineLabel β€” Class DtCCurrentLineLabel, Type XmString, Default Dynamic, Access CSG
  • DtNfindButtonLabel β€” Class DtCFindButtonLabel, Type XmString, Default Dynamic, Access CSG
  • DtNfindChangeDialogTitle β€” Class DtCFindChangeDialogTitle, Type XmString, Default Dynamic, Access CSG
  • DtNfindFieldLabel β€” Class DtCFindFieldLabel, Type XmString, Default Dynamic, Access CSG
  • DtNformatAllButtonLabel β€” Class DtCFormatAllButtonLabel, Type XmString, Default Dynamic, Access CSG
  • DtNformatParagraphButtonLabel β€” Class DtCFormatParagraphButtonLabel, Type XmString, Default Dynamic, Access CSG
  • DtNformatSettingsDialogTitle β€” Class DtCFormatSettingsDialogTitle, Type XmString, Default Dynamic, Access CSG
  • DtNinformationDialogTitle β€” Class DtCInformationDialogTitle, Type XmString, Default Dynamic, Access CSG
  • DtNjustifyToggleLabel β€” Class DtCJustifyToggleLabel, Type XmString, Default Dynamic, Access CSG
  • DtNleftAlignToggleLabel β€” Class DtCLeftAlignToggleLabel, Type XmString, Default Dynamic, Access CSG
  • DtNleftMarginFieldLabel β€” Class DtCLeftMarginFieldLabel, Type XmString, Default Dynamic, Access CSG
  • DtNmisspelledListLabel β€” Class DtCMisspelledListLabel, Type XmString, Default Dynamic, Access CSG
  • DtNoverstrikeLabel β€” Class DtCOverstrikeLabel, Type XmString, Default Dynamic, Access CSG
  • DtNrightAlignToggleLabel β€” Class DtCRightAlignToggleLabel, Type XmString, Default Dynamic, Access CSG
  • DtNrightMarginFieldLabel β€” Class DtCRightMarginFieldLabel, Type XmString, Default Dynamic, Access CSG
  • DtNspellDialogTitle β€” Class DtCSpellDialogTitle, Type XmString, Default Dynamic, Access CSG
  • DtNtotalLineCountLabel β€” Class DtCTotalLineCountLabel, Type XmString, Default Dynamic, Access CSG

(And if you're wondering about the stray tgroup dispwid="7.46in" floating around β€” that's just the width attribute of the original table. Iconic formatting lore, iykyk. πŸ’€)

Now the actual goss, resource by resource:

  • DtNcenterToggleLabel β€” the label for the center alignment toggle button in the Format Settings dialog. Default value in the C locale is Center.
  • DtNchangeAllButtonLabel β€” the label for the button in the Find/Change and Spell dialogs that changes all occurrences of the find string in the document. Default in the C locale is Change All.
  • DtNchangeButtonLabel β€” the label for the button in the Find/Change and Spell dialogs that changes the next occurrence of the find string in the document. Default in the C locale is Change.
  • DtNchangeFieldLabel β€” the label for the field in the Find/Change dialog where the user specifies the replacement string. Default in the C locale is Change To:.
  • DtNcurrentLineLabel β€” the label for the current line number field in the status line. Default in the C locale is Line:.
  • DtNfindButtonLabel β€” the label for the button in the Find/Change dialog that finds the next occurrence of the find string in the document. Default in the C locale is Find.
  • DtNfindChangeDialogTitle β€” the title for the Find/Change dialog. If DtNdialogTitle is non-NULL, it gets added as a prefix to this resource to form the title. Default in the C locale is Find/Change.
  • DtNfindFieldLabel β€” the label for the field in the Find/Change dialog where the user specifies the search string. Default in the C locale is Find:.
  • DtNformatAllButtonLabel β€” the label for the button in the Format Settings dialog that formats the complete document. Default in the C locale is All.
  • DtNformatParagraphButtonLabel β€” the label for the button in the Format Settings dialog that formats the paragraph containing the insertion cursor. Default in the C locale is Paragraph.
  • DtNformatSettingsDialogTitle β€” the title for the Format Settings dialog. If DtNdialogTitle is non-NULL, it's added as a prefix to this resource to form the title. Default in the C locale is Format Settings.
  • DtNinformationDialogTitle β€” the title for the Information dialog, the one used to present feedback and general information to the user. If DtNdialogTitle is non-NULL, it's added as a prefix to this resource to form the title. Default in the C locale is Information.
  • DtNjustifyToggleLabel β€” the label for the justify alignment toggle button in the Format Settings dialog. Default in the C locale is Justify.
  • DtNleftAlignToggleLabel β€” the label for the left alignment toggle button in the Format Settings dialog. Default in the C locale is Left Align.
  • DtNleftMarginFieldLabel β€” the label for the left margin value field in the Format Settings dialog. Default in the C locale is Left Margin:.
  • DtNmisspelledListLabel β€” the label for the list of unrecognized and misspelled words in the Spell dialog. Default in the C locale is Misspelled Words:. 😭 (we've all been there)
  • DtNoverstrikeLabel β€” the label in the status line that indicates the DtEditor widget is in overstrike mode. Default in the C locale is Overstrike.
  • DtNrightAlignToggleLabel β€” the label for the right alignment toggle button in the Format Settings dialog. Default in the C locale is Right Align.
  • DtNrightMarginFieldLabel β€” the label for the right margin value field in the Format Settings dialog. Default in the C locale is Right Margin:.
  • DtNspellDialogTitle β€” the title for the Spell dialog. If DtNdialogTitle is non-NULL, it's added as a prefix to this resource to form the title. Default in the C locale is Spell.
  • DtNtotalLineCountLabel β€” the label for the display showing the total number of lines in the document. That total number of lines displayed is part of the status line. Default in the C locale is Total:.

πŸ’« Inherited Resources πŸ’«

okay so bestie, the DtEditor widget is literally built out of its superclasses β€” it inherits behavior and resources from every one of these named superclasses, and if you want the full tea on any single resource you gotta go read that superclass's own man page. here's the whole family tree with every resource laid out πŸ’–

🩷 XmForm Resource Set

  • XmNfractionBase β€” class XmCMaxValue, type int, default 100, access CSG
  • XmNhorizontalSpacing β€” class XmCSpacing, type Dimension, default 0, access CSG
  • XmNrubberPositioning β€” class XmCRubberPositioning, type Boolean, default False, access CSG
  • XmNverticalSpacing β€” class XmCSpacing, type Dimension, default 0, access CSG

πŸ¦‹ XmBulletinBoard Resource Set

  • XmNallowOverlap β€” class XmCAllowOverlap, type Boolean, default True, access CSG
  • XmNautoUnmanage β€” class XmCAutoUnmanage, type Boolean, default True, access CG
  • XmNbuttonFontList β€” class XmCButtonFontList, type XmFontList, default dynamic, access CSG
  • XmNcancelButton β€” class XmCWidget, type Window, default NULL, access SG
  • XmNdefaultButton β€” class XmCWidget, type Window, access SG
  • XmNdefaultPosition β€” class XmCDefaultPosition, type Boolean, default True, access CSG
  • XmNdialogStyle β€” class XmCDialogStyle, type unsigned char, default dynamic, access CSG
  • XmNdialogTitle β€” class XmCDialogTitle, type XmString, default NULL, access CSG
  • XmNfocusCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNlabelFontList β€” class XmCLabelFontListk, type XmFontList, default dynamic, access CSG
  • XmNmapCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNmarginHeight β€” class XmCMarginHeight, type Dimension, default 10, access CSG
  • XmNmarginWidth β€” class XmCMarginWidth, type Dimension, default 10, access CSG
  • XmNnoResize β€” class XmCNoResize, type Boolean, default False, access CSG
  • XmNresizePolicy β€” class XmCResizePolicy, type unsigned char, default XmRESIZE_ANY, access CSG
  • XmNshadowType β€” class XmCShadowType, type unsigned char, default XmSHADOW_OUT, access CSG
  • XmNtextFontList β€” class XmCTextFontList, type XmFontList, default dynamic, access CSG
  • XmNtextTranslations β€” class XmCTranslations, type XtTranslations, default NULL, access C
  • XmNunmapCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C

🧚 XmManager Resource Set

  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNforeground β€” class XmCForeground, type Pixel, default dynamic, access CSG
  • XmNhelpCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNhighlightColor β€” class XmCHighlightColor, type Pixel, default dynamic, access CSG
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG
  • XmNinitialFocus β€” class XmCInitialFocus, type Widget, default NULL, access CSG
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default dynamic, access CSG
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default dynamic, access CSG
  • XmNstringDirection β€” class XmCStringDirection, type XmStringDynamic, default dynamic, access CG
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default dynamic, access CSG
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG

🌸 Composite Resource Set

  • XmNchildren β€” class XmCReadOnly, type WidgetList, default NULL, access G
  • XmNinsertPosition β€” class XmCInsertPosition, type XtOrderProc, default default procedure, access CSG
  • XmNnumChildren β€” class XmCReadOnly, type Cardinal, default 0, access G

⭐ Core Resource Set

  • XmNaccelerators β€” class XmCAccelerators, type XtAccelerators, default dynamic, access CSG
  • XmNancestorSensitive β€” class XmCSensitive, type Boolean, default dynamic, access G
  • XmNbackground β€” class XmCBackground, type Pixel, default dynamic, access CSG
  • XmNbackgroundPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderColor β€” class XmCBorderColor, type Pixel, default XtDefaultForeground, access CSG
  • XmNborderPixmap β€” class XmCPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNborderWidth β€” class XmCBorderWidth, type Dimension, default 0, access CSG
  • XmNcolormap β€” class XmCColormap, type Colormap, default dynamic, access CG
  • XmNdepth β€” class XmCDepth, type int, default dynamic, access CG
  • XmNdestroyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNheight β€” class XmCHeight, type Dimension, default dynamic, access CSG
  • XmNinitialResourcesPersistent β€” class XmCInitialResourcesPersistent, type Boolean, default True, access C
  • XmNmappedWhenManaged β€” class XmCMappedWhenManaged, type Boolean, default True, access CSG
  • XmNscreen β€” class XmCScreen, type Screen *, default dynamic, access CG
  • XmNsensitive β€” class XmCSensitive, type Boolean, default True, access CSG
  • XmNtranslations β€” class XmCTranslations, type XtTranslations, default dynamic, access CSG
  • XmNwidth β€” class XmCWidth, type Dimension, default dynamic, access CSG
  • XmNx β€” class XmCPosition, type Position, default 0, access CSG
  • XmNy β€” class XmCPosition, type Position, default 0, access CSG

πŸŽ€ Callback Information πŸŽ€

the DtEditor widget has three callback functions of interest, and honestly they're the whole personality of this thing:

  • DtNtextSelectCallback and DtNtextDeselectCallback β€” these two resources let an application enable and disable certain commands or menu items based on whether there is a selection πŸ‘‘ DtNtextSelectCallback specifies a function that gets called whenever the selection becomes non-NULL (that is, some text is selected within the edit window), while DtNtextDeselectCallback specifies a function called whenever the selection becomes NULL (that is, no text is selected within the edit window). the reasons sent by the callbacks are DtEDITOR_TEXT_SELECT and DtEDITOR_TEXT_DESELECT ✨
  • XmNhelpCallback β€” if your app wants to present help info to the user about the DtEditor widget and its dialogs, you should set the XmNhelpCallback resource and use the Reason field passed as part of DtEditorHelpCallbackStruct to set the contents of your Help dialog πŸ’… a pointer to the following structure is passed to the XmNhelpCallback callback:
typedef struct {
        int reason,
        XEvent *event
} XmAnyCallbackStruct;
  • reason β€” indicates why the callback was invoked 😭 the possible reasons are:
    • DtEDITOR_HELP_EDIT_WINDOW β€” the help request originated in the edit window.
    • DtEDITOR_HELP_STATUS_LINE β€” the help request originated in the status line.
    • DtEDITOR_HELP_STATUS_CURRENT_LINE β€” the help request originated in the Current Line number display in the status line.
    • DtEDITOR_HELP_STATUS_TOTAL_LINES β€” the help request originated in the Total Lines display in the status line.
    • DtEDITOR_HELP_STATUS_MESSAGE β€” the help request originated in the Message field in the status line.
    • DtEDITOR_HELP_STATUS_OVERSTRIKE β€” the help request originated in the Overstrike Indicator in the status line.
    • DtEDITOR_HELP_FORMAT_DIALOG β€” the help request originated in the Help button in the Format dialog.
    • DtEDITOR_HELP_FORMAT_LEFT_MARGIN β€” the help request originated in the Left Margin field in the Format dialog.
    • DtEDITOR_HELP_FORMAT_RIGHT_MARGIN β€” the help request originated in the Right Margin field in the Format dialog.
    • DtEDITOR_HELP_FORMAT_ALIGNMENT β€” the help request originated in the Alignment buttons in the Format dialog.
    • DtEDITOR_HELP_CHANGE_DIALOG β€” the help request originated in the Help button in the Find/Change dialog.
    • DtEDITOR_HELP_CHANGE_FIND β€” the help request originated in the Find field in the Find/Change dialog.
    • DtEDITOR_HELP_CHANGE_CHANGE β€” the help request originated in the Change To field in the Find/Change dialog.
    • DtEDITOR_HELP_SPELL_DIALOG β€” the help request originated in the help button in the Spell dialog.
    • DtEDITOR_HELP_SPELL_MISSPELLED_WORDS β€” the help request originated in the List of Misspelled Words in the Spell dialog.
    • DtEDITOR_HELP_SPELL_CHANGE β€” the help request originated in the Change To field in the Spell dialog.
  • event β€” a pointer to the XEvent that caused this callback to be invoked. it may be NULL 🫢

🩡 Translations 🩡

the DtEditor widget translations for the edit window are described in the following list, and heads up: the DtNtextTranslations resource can be used to modify these translations πŸ‘€

  • KLeft β€” backward-character
  • MShift KLeft β€” key-select
    • (left)
  • MCtrl KLeft β€” backward-word
  • MShift MCtrl KLeft β€” backward-word
    • (extend)
  • KRight β€” forward-character
  • MShift KRight β€” key-select
    • (right)
  • MCtrl KRight β€” forward-word
  • MShift MCtrl KRight β€” forward-word

(extend) β€” same move, but the selection gets dragged along πŸ’…

  • KUp β€” process-up
  • MShift KUp β€” process-shift-up
  • MCtrl KUp β€” backward-paragraph
  • MShift MCtrl KUp β€” backward-paragraph

(extend)

  • KDown β€” process-down
  • MShift KDown β€” process-shift-down
  • MCtrl KDown β€” forward-paragraph
  • MShift MCtrl KDown β€” forward-paragraph

(extend)

  • KBeginLine β€” beginning-of-line
  • MShift KBeginLine β€” beginning-of-line

(extend)

  • KEndLine β€” end-of-line
  • MShift KEndLine β€” end-of-line

(extend)

  • KPageUp β€” previous-page
  • MShift KPageUp β€” previous-page

(extend)

  • KPageLeft β€” page-left
  • KPageDown β€” next-page
  • MShift KPageDown β€” next-page

(extend)

  • KPageRight β€” page-right
  • KBeginData β€” beginning-of-file
  • MShift KBeginData β€” beginning-of-file

(extend)

  • KEndData β€” end-of-file
  • MShift KEndData β€” end-of-file

(extend)

  • KDelete β€” delete-next-character
  • MCtrl KDelete β€” delete-to-end-of-line
  • KBackSpace β€” delete-previous-character
  • MCtrl KBackSpace β€” delete-previous-word
  • MShift KBackSpace β€” delete-to-start-of-line
  • MAlt KBackSpace β€” undo-edit
  • MCtrl Kz β€” undo-edit
  • MCtrl K/ β€” select-all
  • MCtrl K β€” deselect-all
  • MCtrl Kg β€” go-to-line
  • MCtrl Kq β€” quote-next-character
  • MCtrl Kx β€” cut-clipboard
  • MCtrl Kc β€” copy-clipboard
  • MCtrl Kv β€” paste-clipboard
  • KHelp β€” Help
  • KInsert β€” toggle-insert-mode
  • KEnter β€” new-line-and-indent
  • MAnyKCancel β€” process-cancel

πŸŽ€ Action Routines πŸŽ€

okay bestie, this is the good part β€” every single action routine the DtEditor widget has, spelled out one by one. no cap, this is the whole menu ✨

backward-character()

This action moves the insertion cursor one character to the left. Heads up: this action may have different behavior in a right-to-left language environment 🫢

backward-paragraph(extend)

If this action is called with no argument, it moves the insertion cursor to the first non-whitespace character following the first previous blank line or beginning of the text. And if the insertion cursor is already at the beginning of a paragraph? Then the action moves the insertion cursor to the beginning of the previous paragraph. cute, right πŸ’–

If this action is called with an argument of extend, it moves the insertion cursor, as in the case of no argument, and extends the current selection.

backward-word( extend)

No argument? It moves the insertion cursor to the first non-whitespace character after the first whitespace character to the left or after the beginning of the line. If the insertion cursor is already at the beginning of a word, this action moves the insertion cursor to the beginning of the previous word. ngl this action may have different behavior in a locale other than the C locale πŸ‘€

With an argument of extend, it moves the insertion cursor, as in the case of no argument, and extends the current selection.

beginning-of-file(extend)

No argument: moves the insertion cursor to the beginning of the text. literally the very top, main character energy πŸ‘‘

With an argument of extend: moves the insertion cursor, as in the case of no argument, and extends the current selection.

beginning-of-line(extend)

No argument: moves the insertion cursor to the beginning of the line.

With an argument of extend: moves the insertion cursor, as in the case of no argument, and extends the current selection.

clear-selection()

This action clears the current selection by replacing each character except <carriage-return> with a <space> character. so it blanks your selection out, but the carriage returns survive the purge, periodt πŸ’…

copy-clipboard()

This action copies the current selection to the clipboard. slay, now paste it somewhere iconic πŸŽ€

cut-clipboard()

This action cuts the current selection to the clipboard.

delete-next-character()

If there is a non-NULL selection, this action deletes the selection; otherwise, it deletes the character following the insertion cursor.

delete-next-word()

If there is a non-NULL selection, this action deletes the selection; otherwise, it deletes the characters following the insertion cursor to the next space, tab or end of line character.

delete-previous-character()

If there is a non-NULL selection, this action deletes the selection; otherwise, it deletes the character of text immediately preceding the insertion cursor.

delete-previous-word()

If there is a non-NULL selection, this action deletes the selection; otherwise, it deletes the characters preceding the insertion cursor to the next space, tab or beginning of the line character. This action may have different behavior in a locale other than the C locale πŸ™ˆ

delete-to-end-of-line()

If there is a non-NULL selection, this action deletes the selection; otherwise, it deletes the characters following the insertion cursor to the next end-of-line character.

delete-to-start-of-line()

If there is a non-NULL selection, this action deletes the selection; otherwise, it deletes the characters preceding the insertion cursor to the previous beginning-of-line character.

deselect-all()

This action deselects the current selection. bye bye highlight 🌸

end-of-file( extend)

No argument: moves the insertion cursor to the end of the text. bottom of the file, we've arrived πŸ¦‹

With an argument of extend: moves the insertion cursor, as in the case of no argument, and extends the current selection.

end-of-line( extend)

No argument: moves the insertion cursor to the end of the line.

With an argument of extend: moves the insertion cursor, as in the case of no argument, and extends the current selection.

forward-character()

This action moves the insertion cursor one character to the right. same disclaimer as its leftward twin: this action may have different behavior in a right-to-left language environment ✨

forward-paragraph(extend)

No argument: moves the insertion cursor to the first non-whitespace character following the next blank line. If the insertion cursor is already at the beginning of a paragraph, this action moves the insertion cursor to the beginning of the next paragraph.

With an argument of extend: moves the insertion cursor, as in the case of no argument, and extends the current selection.

forward-word( extend)

No argument: moves the insertion cursor to the first whitespace character or end-of-line following the next non-whitespace character. If the insertion cursor is already at the end of a word, this action moves the insertion cursor to the end of the next word. yep, and this action may have different behavior in a locale other than the C locale πŸ’€

If called with an argument of extend, this action moves the insertion cursor, as in the case of no argument, and extends the current selection.

go-to-line()

This action moves the keyboard focus to the Current Line text field to allow the user to move the insertion cursor to a new line. Important vibe check: this action is only valid if DtNshowStatusLine has a value of True. For a description of the status line, see the Editor Status Line heading in this manual page πŸ‘‘

Help()

This action calls the callbacks for XmNhelpCallback if any exist. If there are no help callbacks for this widget, this action calls the help callbacks for the nearest ancestor that has them. it's giving "ask your mom if you don't know" energy 🫢

insert-string( string)

This action deletes the entire selection if there is a non-NULL selection and the cursor is not disjoint from it. It inserts string before the insertion cursor.

key-select( direction)

Called with an argument of right? It moves the insertion cursor one character to the right and extends the current selection. Called with an argument of left? It moves the insertion cursor one character to the left and extends the current selection. Called with no argument? It just extends the current selection 🌈

newline-and-backup()

If there is a non-NULL selection and the cursor is not disjoint from it, this action deletes the entire selection, inserts a newline just before the insertion cursor and repositions the insertion cursor to the end of the line before the newline.

newline-and-indent()

If there is a non-NULL selection and the cursor is not disjoint from it, this action deletes the entire selection, inserts a newline and then the same number of whitespace characters as at the beginning of the previous line. auto-indent ate, honestly πŸ“

next-page( extend)

No argument: moves the insertion cursor forward one page.

With an argument of extend: moves the insertion cursor, as in the case of no argument, and extends the current selection.

page-left()

This action scrolls the viewing window left one page of text.

page-right()

This action scrolls the viewing window right one page of text.

paste-clipboard()

This action pastes the contents of the clipboard before the insertion cursor.

previous-page( extend)

No argument: moves the insertion cursor back one page.

and if this action gets called with an argument of extend, it moves the insertion cursor exactly like the no-argument case, and it extends the current selection. πŸ’…

  • process-cancel() β€” cancels the current extend-adjust or secondary-adjust operation and leaves the selection state exactly how it was before the operation; otherwise, and if the parent is a manager, it passes the event to the parent.
  • process-down() β€” moves the insertion cursor down one line.
  • process-shift-down() β€” moves the insertion cursor down one line and extends the current selection.
  • process-shift-up() β€” moves the insertion cursor up one line and extends the current selection.
  • process-up() β€” moves the insertion cursor up one line.
  • select-all() β€” selects all text.
  • toggle-insert-mode() β€” toggles the state of the text insertion mode. By default, characters typed into the DtEditor widget are inserted at the position of the insertion cursor. In overstrike mode, characters entered into the DtEditor widget replace the characters that directly follow the insertion cursor. In overstrike mode, characters are appended to the end of the line when the end of a line is reached.
  • quote-next-character() β€” treats the next typed character as a special character and inserts it into the text without interpreting it. This enables the insertion of special instructional characters or special language characters, such as the character marking a form feed or the umlaut used in German text.
  • undo-edit() β€” undoes the last change (deletion or insertion) made to the text. A change consists of either a set of consecutive insertions, or a set of consecutive deletions followed by up to one set of consecutive insertions. An insertion is consecutive if there have been no intervening deletions, and it is continuing forward from the same point. A deletion is consecutive if there have been no intervening insertions, and its start or end position is coincidental with the last deletion (that is, the deletion is continuing from the same point, either forward or backward). Undoing an edit once restores the original text. Undoing an edit twice restores the last change. 😭

🫢 Convenience Functions 🫢

The Widget Library contains a number of functions that apply to the DtEditor widget. The following lists summarize these functions.

🌱 DtEditor Life Cycle Functions 🌱

  • DtCreateEditor() β€” creates a new instance of a DtEditor widget.
  • DtEditorReset() β€” restores a DtEditor widget to its initial state.

🧚 DtEditor Input/Output Functions 🧚

  • DtEditorAppend() β€” appends content data to the end of a DtEditor widget.
  • DtEditorAppendFromFile() β€” appends the contents of a file to the end of a DtEditor widget.
  • DtEditorGetContents() β€” retrieves the entire contents of a DtEditor widget.
  • DtEditorInsert() β€” inserts content data at the current insert position.
  • DtEditorInsertFromFile() β€” inserts the contents of a file at the current insert position.
  • DtEditorReplace() β€” replaces a portion of text with the supplied data.
  • DtEditorReplaceFromFile() β€” replaces a portion of text with the contents of a file.
  • DtEditorSaveContentsToFile() β€” saves the entire contents to a file.
  • DtEditorSetContents() β€” loads content data into a DtEditor widget, replacing the entire contents of the widget.
  • DtEditorSetContentsFromFile() β€” loads the contents of a file into a DtEditor widget, replacing the entire contents of the widget.

πŸ¦‹ DtEditor Selection Functions πŸ¦‹

  • DtEditorClearSelection() β€” replaces the currently selected contents with blanks.
  • DtEditorCopyToClipboard() β€” copies the currently selected contents to the clipboard.
  • DtEditorCutToClipboard() β€” removes the currently selected contents, placing it on the clipboard.
  • DtEditorDeleteSelection() β€” removes the currently selected contents.
  • DtEditorDeselect() β€” deselects any selected contents.
  • DtEditorPasteFromClipboard() β€” pastes the contents of the clipboard into a DtEditor widget, replacing any currently selected contents.
  • DtEditorSelectAll() β€” selects the entire contents of a DtEditor widget.

πŸŽ€ DtEditor Format Functions πŸŽ€

  • DtEditorFormat() β€” formats the contents of all or part of a DtEditor widget.
  • DtEditorInvokeFormatDialog() β€” displays the format dialog that enables the user to specify format settings for margins and justification style and to perform formatting operations.

πŸ” DtEditor Find and Change Text Functions πŸ”

  • DtEditorChange() β€” changes one or all occurrences of a string.
  • DtEditorFind() β€” finds the next occurrence of a string.
  • DtEditorInvokeFindChangeDialog() β€” displays the dialog that enables the user to search for, and optionally change, a string.
  • DtEditorInvokeSpellDialog() β€” displays a dialog with a list of misspelled words in the current contents.

✨ DtEditor Auxiliary Functions ✨

  • DtEditorDisableRedisplay() β€” temporarily prevents visual update of a DtEditor widget.
  • DtEditorEnableRedisplay() β€” forces the visual update of a DtEditor widget.
  • DtEditorCheckForUnsavedChanges() β€” reports whether the contents of a DtEditor widget have been altered since they were last retrieved or saved.
  • DtEditorGetInsertionPosition() β€” returns the insertion cursor position of a DtEditor widget.
  • DtEditorGetLastPosition() β€” returns the position of the last character in the edit window.
  • DtEditorGetMessageTextFieldID() β€” retrieves the widget ID of the Text Field widget used to display application messages.
  • DtEditorGetSizeHints() β€” retrieves sizing information from a DtEditor widget.
  • DtEditorGoToLine() β€” moves the insert cursor to the specified line.
  • DtEditorSetInsertionPosition() β€” sets the position of the insertion cursor.
  • DtEditorTraverseToEditor() β€” sets keyboard traversal to the edit window of a DtEditor widget.
  • DtEditorUndoEdit() β€” undoes the last edit made by a user.

πŸ“ FILES πŸ“

  • /nix/store/6waxpwr8lzfzc9ka48gl7yh60rqvlkdb-cde-2.5.3/lib/nls/msg/$LANG/DtWidget.cat() β€” message catalog for DtWidget library.

πŸ‘€ SEE ALSO πŸ‘€

Okay bestie, the group chat is huge, but every single one is here: header Dt/Editor.h starts it off with DtEditor(5), DtCreateEditor(3), DtEditorAppend(3), DtEditorAppendFromFile(3), DtEditorChange(3), DtEditorCheckForUnsavedChanges(3), DtEditorClearSelection(3), DtEditorCopyToClipboard(3), DtEditorCutToClipboard(3), DtEditorDeleteSelection(3), DtEditorDeselect(3), DtEditorDisableRedisplay(3), DtEditorEnableRedisplay(3), DtEditorFind(3), DtEditorFormat(3), DtEditorGetContents(3), DtEditorGetInsertionPosition(3), DtEditorGetLastPosition(3), DtEditorGetMessageTextFieldID(3), DtEditorGetSizeHints(3), DtEditorGoToLine(3), DtEditorInsert(3), DtEditorInsertFromFile(3), DtEditorInvokeFindChangeDialog(3), DtEditorInvokeFormatDialog(3), DtEditorInvokeSpellDialog(3), DtEditorPasteFromClipboard(3), DtEditorReplace(3), DtEditorReplaceFromFile(3), DtEditorReset(3), DtEditorSaveContentsToFile(3), DtEditorSelectAll(3), DtEditorSetContents(3), DtEditorSetContentsFromFile(3), DtEditorSetInsertionPosition(3), DtEditorTraverseToEditor(3), DtEditorUndoEdit(3); plus Composite(3), Constraint(3), Core(3), XmBulletinBoard(3), XmFontList(3), XmForm(3), XmManager(3), and XmTextField(3).


Bye bestie β€” final footer vibes: DtEditor(library call), source/version CDE 2.5.3, and the date is whatever your local manpage footer prints there πŸ’–

πŸ“¦ where this page comes from