XMTEXT(3)

πŸ“¦
version 2.3.8 Β· 3 versions
, in arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ NAME ✨

Okay bestie, this is XmText β€” literally The Text widget class. It's a library call, so it's giving Unix manual energy. πŸ’…


✨ SYNOPSIS ✨

#include <Xm/Text.h>

✨ DESCRIPTION ✨

So Text is your go-to for a single-line AND multiline text editor, and you can customize both user and programmatic interfaces with it. It's perfect for single-line string entry, forms entry with verification procedures, and full-window editing. Basically it gives your app a consistent editing system for textual data, and the screen's textual data adjusts to whatever the application writer needs. Slay. ✨

Text has separate callback lists to verify movement of the insert cursor, modification of the text, and changes in input focus. Each callback hands the verification function the widget instance, the event that caused the callback, and a data structure specific to the verification type. From that info, the function can verify if the application thinks this is a legit state change and can signal the widget whether to continue with the action. It's giving gatekeeping but in a good way. πŸ’…

The user interface tailors a new set of translations. The default translations give you key bindings for insert cursor movement, deletion, insertion, and selection of text. So you can keyboard warrior your way through editing. πŸ”₯

Text lets the user select regions of text. Selection follows the model from the Inter-Client Communication Conventions Manual (ICCCM). Text supports primary and secondary selection. It's iconic, no cap. πŸ’–

In some Asian languages, texts are drawn vertically. Also, some characters are displayed with 90-degree clockwise rotation, and other characters are mapped to vertical glyphs that differ from the normal horizaontal glyphs. Info about which characters need rotation or mapping to vertical glyphs lives in the X Locale Database (NLS databases) and is handled by the X library, depending on XNOrientation XOC values. The XmText widget should also handle vertically aligned lines for editing, entering, or selecting texts. Periodt. πŸ’…

The vertical writing feature of the XmText widget turns on when you set the XmTOP_TO_BOTTOM value for the XmNlayoutDirection resource of the XmText widget. When that happens, the horizontal scroll bar shows up on the bottom of the XmText widget and the vertical scroll bar shows up on the left side. It's a whole vibe. πŸ¦‹


✨ Mouse Selection ✨

The Text widget lets you edit, insert, and select text. The user can cut, copy, and paste text using the clipboard, primary transfer, or secondary transfer. Text also has a Drag and Drop facility so you can copy or move data within Text or to a different widget. When keyboard focus policy is set to EXPLICIT, the widget that receives focus is the destination widget. In POINTER mode, any keyboard or mouse operation (except secondary selection) in an editable widget makes that widget the destination. It's giving multitasking queen. πŸ‘‘

If a destination widget becomes insensitive or uneditable, it forfeits its destination status. In EXPLICIT mode, when a widget becomes insensitive, the focus moves to another widget. If that widget is editable, it becomes the destination widget; otherwise, there's no destination widget. The text of any insensitive Text widget is stippled, which shows its state to the user. No cap. πŸ’€

The insertion cursor, displayed as an I-beam, shows where input is inserted. Input is inserted just before the insertion cursor. Simple as that. ✨

Text uses the XmQTnavigator, XmQTspecifyRenderTable, and XmQTscrollFrame traits, and holds the XmQTaccessTextual and XmQTtransfer traits. The widget checks its parent for the XmQTscrollFrame trait. If this trait doesn't exist, then the widget has no scrolling. If the trait does exist, and the ScrollFrame widget hasn't been initialized, the widget creates two navigators and sets up the scrollbars. It's lowkey doing the most. πŸ’…

If an application or widget calls the setValue trait method of XmQTaccessTextual, then XmText will call XmTextSetString to set the string value. Periodt. πŸŽ€


✨ Classes ✨

Text inherits behavior, resources, and traits from Core and XmPrimitive.

The class pointer is xmTextWidgetClass.

The class name is XmText.

It's giving family tree realness. 🌈


✨ Data Transfer Behavior ✨

Text supports transfer of the primary, secondary, and clipboard selections and dragging of selected text from the widget. Text can also be the destination for the primary, secondary, and clipboard selections, and it supports dropping of data being dragged onto the widget. It's giving data exchange realness. πŸ’…

When the XmNconvertCallback procedures are called, the location_data member of the XmConvertCallbackStruct member is NULL if the selected text is being transferred. If the entire text, not the selected text, is being transferred, the value of this member is the widget ID of the Text widget. No cap. πŸ”₯

As a source of data, Text supports the following targets and associated conversions of data to these targets:

  • locale β€” If the locale target matches the widget's locale, the widget transfers the selected text in the encoding of the locale.
  • COMPOUND_TEXT β€” The widget transfers the selected text as type COMPOUND_TEXT.
  • STRING β€” The widget transfers the selected text as type STRING.
  • TEXT β€” If the selected text is fully convertible to the encoding of the locale, the widget transfers the selected text in the encoding of the locale. Otherwise, the widget transfers the selected text as type COMPOUND_TEXT.
  • UTF8_STRING β€” The widget transfers the selected text as type UTF8_STRING.
  • DELETE β€” The widget deletes the selected text.
  • _MOTIF_CLIPBOARD_TARGETS β€” The widget transfers, as type ATOM, a list of the targets to which the widget can convert data to be placed on the clipboard immediately. If the selected text is fully convertible to STRING, these include STRING; otherwise, they include COMPOUND_TEXT.
  • _MOTIF_DEFERRED_CLIPBOARD_TARGETS β€” The widget transfers, as type ATOM, a list of the targets it supports for delayed transfer for the CLIPBOARD selection. This widget currently supplies no targets for _MOTIF_DEFERRED_CLIPBOARD_TARGETS.
  • _MOTIF_EXPORT_TARGETS β€” The widget transfers, as type ATOM, a list of the targets to be used as the value of the DragContext's XmNexportTargets in a drag-and-drop transfer. These include COMPOUND_TEXT, UTF8_STRING, the encoding of the locale, STRING, TEXT, BACKGROUND, and FOREGROUND.
  • _MOTIF_LOSE_SELECTION β€” The widget takes the following actions:
    • When losing the PRIMARY selection, it unhighlights the selected text and calls the XmNlosePrimaryCallback procedures.
    • When losing the SECONDARY selection, it removes the secondary selection highlight.
    • When losing the _MOTIF_DESTINATION selection, if the widget does not have focus, it changes the cursor to indicate that the widget is no longer the destination.

As a source of data, Text also supports the following standard Motif targets:

  • BACKGROUND β€” The widget transfers XmNbackground as type PIXEL.
  • CLASS β€” The widget finds the first shell in the widget hierarchy that has a WM_CLASS property and transfers the contents as text in the current locale.
  • CLIENT_WINDOW β€” The widget finds the first shell in the widget hierarchy and transfers its window as type WINDOW.
  • COLORMAP β€” The widget transfers XmNcolormap as type COLORMAP.
  • FOREGROUND β€” The widget transfers XmNforeground as type PIXEL.
  • NAME β€” The widget finds the first shell in the widget hierarchy that has a WM_NAME property and transfers the contents as text in the current locale.
  • TARGETS β€” The widget transfers, as type ATOM, a list of the targets it supports. These include the standard targets in this list. These also include COMPOUND_TEXT, UTF8_STRING, the encoding of the locale, STRING, and TEXT.
  • TIMESTAMP β€” The widget transfers the timestamp used to acquire the selection as type INTEGER.
  • _MOTIF_RENDER_TABLE β€” The widget transfers XmNrenderTable if it exists, or else the default text render table, as type STRING.
  • _MOTIF_ENCODING_REGISTRY β€” The widget transfers its encoding registry as type STRING. The value is a list of NULL separated items in the form of tag encoding pairs. This target symbolizes the transfer target for the Motif Segment Encoding Registry. Widgets and applications can use this Registry to register text encoding formats for specified render table tags. Applications access this Registry by calling XmRegisterSegmentEncoding and XmMapSegmentEncoding.

As a destination for data, Text chooses a target and requests conversion of the selection to that target. If the encoding of the locale is present in the list of available targets, Text chooses a requested target from the available targets in the following order of preference:

  1. The encoding of the locale
  2. TEXT
  3. UTF8_STRING
  4. COMPOUND_TEXT
  5. STRING

If the encoding of the locale is not present in the list of available targets, Text chooses a requested target from the available targets in the following order of preference:

  1. UTF8_STRING
  2. COMPOUND_TEXT
  3. STRING

✨ New Resources ✨

The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A). It's giving configuration realness. πŸ’…


πŸŽ€ XmText Resource Set πŸŽ€

okay bestie, this is the whole lineup β€” every resource XmText has, and it's giving full menu energy πŸ’…. Every single one of these comes at you with five things:

  • Name β€” the resource name, the thing you actually type.
  • Class β€” the class it rolls with.
  • Type β€” what kind of value it wants from you.
  • Default β€” what you get if you say absolutely nothing.
  • Access β€” how you're allowed to touch it. The codes in this table are C, CSG, and CSG1.

Here we go, one by one, no skipping, we do not leave the girlies behind ✨

  • XmNactivateCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. a callback slot, and it starts out completely empty.
  • XmNautoShowCursorPosition β€” class XmCAutoShowCursorPosition, type Boolean, default True, access CSG. yes/no situation, and the default is a big ol' yes.
  • XmNcursorPosition β€” class XmCCursorPosition, type XmTextPosition, default 0, access CSG. starts at 0, like every good index.
  • XmNcursorPositionVisible β€” class XmCCursorPositionVisible, type Boolean, default dynamic, access CSG. note that the default here is dynamic, not a plain true/false, okay? okay.
  • XmNdestinationCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. another empty callback slot at the start.
  • XmNeditable β€” class XmCEditable, type Boolean, default True, access CSG. can you edit it? default says yes πŸ’–
  • XmNeditMode β€” class XmCEditMode, type int, default XmSINGLE_LINE_EDIT, access CSG. an int, and out of the box you're in XmSINGLE_LINE_EDIT.
  • XmNfocusCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. callback slot, starts NULL, as the girlies do.
  • XmNgainPrimaryCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. callback slot, NULL default, iconic.
  • XmNlosePrimaryCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. yes bestie, also a callback slot, also NULL.
  • XmNlosingFocusCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. and again: callback slot, NULL default 🫢
  • XmNmarginHeight β€” class XmCMarginHeight, type Dimension, default 5, access CSG. a Dimension, default 5.
  • XmNmarginWidth β€” class XmCMarginWidth, type Dimension, default 5, access CSG. also a Dimension, also 5. symmetry, we love her.
  • XmNmaxLength β€” class XmCMaxLength, type int, default largest integer, access CSG. the default is literally largest integer, so like… go off, no cap 😭
  • XmNmodifyVerifyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. callback slot, NULL at the start.
  • XmNmodifyVerifyCallbackWcs β€” class XmCCallback, type XtCallbackList, default NULL, access C. the Wcs sibling, same deal: callback slot, NULL.
  • XmNmotionVerifyCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. callback slot, NULL, we've been here before πŸ’€
  • XmtotalLines β€” class XmCTotalLines, type int, default dynamic, access C. heads up bestie, this one is written XmtotalLines β€” no N in there β€” and the default is dynamic. That's exactly how it appears, so don't go "fixing" it, fr fr.
  • XmNsource β€” class XmCSource, type XmTextSource, default Default source, access CSG. an XmTextSource, and it defaults to the Default source.
  • XmNtopCharacter β€” class XmCTopCharacter, type XmTextPosition, default 0, access CSG. starts at 0.
  • XmNvalue β€” class XmCValue, type String, default "", access CSG. a String, defaulting to "" β€” empty, blank, a clean slate ✨
  • XmNvalueChangedCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C. callback slot, NULL default, you know the drill.
  • XmNvalueWcs β€” class XmCvalueWcs, type wchar_t *, default (wchar_t *)"", access CSG1. yep, the class really is XmCvalueWcs with a lowercase v, and the default is (wchar_t *)"". Also notice the access is CSG1, not plain CSG β€” the 1 is doing something, see the note below πŸ‘‡
  • XmNverifyBell β€” class XmCVerifyBell, type Boolean, default dynamic, access CSG. a Boolean with a dynamic default.

1 This resource cannot be set in a resource file.

that little footnote is the whole reason XmNvalueWcs says CSG1 and not just CSG β€” so if you were about to yeet it into a resource file, don't πŸ™ˆ

and there's more where that came from, so stay tuned πŸ’–

  • XmNactivateCallback β€” the callback list that fires when the user does the thing that calls the activate() action. The struct whose address gets passed along is an XmAnyCallbackStruct, and the reason it sends is XmCR_ACTIVATE. classic activation moment ✨
  • XmNautoShowCursorPosition β€” set it to True and the visible text is guaranteed to contain the insert cursor. Cursor moves? The contents of Text may scroll to bring that insertion point into the window. but heads up bestie: setting this to False does not promise Text won't scroll. It's just not obligated to. πŸ™ˆ
  • XmNcursorPosition β€” tells you where in the text the current insert cursor is supposed to sit. It's counted as the number of characters from the beginning of the text, and the first character position is 0 (zero). zero-indexed, as the universe intended πŸ’…
  • XmNcursorPositionVisible β€” if the widget has an XmPrintShell as one of its ancestors, the default is False. Otherwise? True. that's it, that's the whole rule πŸŽ€
  • XmNdestinationCallback β€” the callback list that fires when the widget is the destination of a transfer operation. The struct address passed to these callbacks is an XmDestinationCallbackStruct, and the reason is XmCR_OK. receiving era 🫢
  • XmNeditable β€” True means the user can edit the text string. False means the user is prohibited from editing it. locked down fr fr πŸ”’
    • When XmNeditable is used on a widget, it sets the dropsite to XmDROP_SITE_ACTIVE.
  • XmNeditMode β€” which set of keyboard bindings Text is rolling with. The default, XmSINGLE_LINE_EDIT, gives you the key bindings for editing single-line text. XmMULTI_LINE_EDIT gives you the ones for editing multiline text. pick your fighter βš”οΈ
    • > warning: the results of putting a Text widget inside a ScrolledWindow when the Text's XmNeditMode is XmSINGLE_LINE_EDIT are undefined. Not "weird", not "buggy" β€” undefined. Don't do it. 😭
  • XmNfocusCallback β€” the callback list that fires when Text accepts input focus. Struct address passed: XmAnyCallbackStruct. Reason sent: XmCR_FOCUS. she's got focus, she's got main character energy πŸ‘‘
  • XmNgainPrimaryCallback β€” the callback list that fires when an event causes the Text widget to gain ownership of the primary selection. Reason sent: XmCR_GAIN_PRIMARY. won the primary, slay 🌈
  • XmNlosePrimaryCallback β€” the callback list that fires when an event causes the Text widget to lose ownership of the primary selection. Reason sent: XmCR_LOSE_PRIMARY. loss arc πŸ˜”
  • XmNlosingFocusCallback β€” the callback list that fires before Text loses input focus. Struct address passed: XmTextVerifyCallbackStruct. Reason sent: XmCR_LOSING_FOCUS. goodbye kiss before the focus dips πŸ¦‹
  • XmNmarginHeight β€” the distance between the top edge of the widget window and the text, and also between the bottom edge of the widget window and the text. top AND bottom, equal treatment ✨
  • XmNmarginWidth β€” the distance between the left edge of the widget window and the text, and between the right edge of the widget window and the text. left AND right, symmetrical queen πŸŽ€
  • XmNmaxLength β€” the maximum length of the text string you can enter into text from the keyboard. This value has to be nonnegative. important: strings entered by using the XmNvalue resource or the XmTextSetString function ignore this resource entirely. the keyboard has rules, the API does not πŸ’…
  • XmNmodifyVerifyCallback β€” the callback list that fires before text is deleted from or inserted into Text. Struct address passed: XmTextVerifyCallbackStruct. Reason sent: XmCR_MODIFYING_TEXT_VALUE. When multiple Text widgets share the same source, only the widget that initiates the source change generates XmNmodifyVerifyCallback. only the originator, not the whole friend group πŸ‘€
    • If both XmNmodifyVerifyCallback and XmNmodifyVerifyCallbackWcs are registered callback lists, the procedure(s) in the XmNmodifyVerifyCallback list is always executed first; and the resulting data β€” which may have been modified β€” is passed to the XmNmodifyVerifyCallbackWcs callback routines. pipeline order matters, no cap πŸ”₯
  • XmNmodifyVerifyCallbackWcs β€” the callback list that fires before text is deleted from or inserted into Text. Struct address passed: XmTextVerifyCallbackStructWcs. Reason sent: XmCR_MODIFYING_TEXT_VALUE. When multiple Text widgets share the same source, only the widget that initiates the source change generates the XmNmodifyVerifyCallbackWcs. same deal, wide-character edition πŸ¦‹
    • If both XmNmodifyVerifyCallback and XmNmodifyVerifyCallbackWcs are registered callback lists, the procedure(s) in the XmNmodifyVerifyCallback list is always executed first; and the resulting data β€” which may have been modified β€” is passed to the XmNmodifyVerifyCallbackWcs callback routines.
  • XmNmotionVerifyCallback β€” the callback list that fires before the insert cursor moves to a new position. Struct address passed: XmTextVerifyCallbackStruct. Reason sent: XmCR_MOVING_INSERT_CURSOR. and btw it is entirely possible for more than one XmNmotionVerifyCallback to be generated from a single action. she multiplies πŸ™ˆ
  • XmNsource β€” the source with which the widget displays text. If no source is specified, the widget creates a default string source. You can use this resource to share text sources between Text widgets. sharing is caring fr fr 🫢
  • XmNtopCharacter β€” displays the position of text at the top of the window. Position is counted as the number of characters from the beginning of the text, and the first character position is 0 (zero). zero again, iconic ⭐
    • If XmNeditMode is XmMULTI_LINE_EDIT, the line of text containing the top character is displayed at the top of the widget without shifting the text left or right.
    • XtGetValues for XmNtopCharacter returns the position of the first character in the line that is displayed at the top of the widget. it gives you the line's first char, not the char you asked about πŸ‘€
  • XmNtotalLines β€” the number of lines in the text widget buffer (not necessarily visible). The initial value 1 means the text buffer is empty. The number of lines reported takes into account the wordWrap policy β€” that is, it's not simply the number of newline characters. word wrap counted, bestie πŸ“
  • XmNvalue β€” the string value of the Text widget as a char* data value. Moves the cursor to position 0 unless a value of XmNcursorPosition was explicitly supplied in the argument list. If XmNvalue and XmNvalueWcs are both defined, the value of XmNvalueWcs supersedes that of XmNvalue. XtGetValues returns a copy of the value of the internal buffer, and XtSetValues copies the string values into the internal buffer. char* girlies rise πŸ”₯
  • XmNvalueChangedCallback β€” the callback list that fires after text is deleted from or inserted into Text. Struct address passed: XmAnyCallbackStruct. Reason sent: XmCR_VALUE_CHANGED. When multiple Text widgets share the same source, only the widget that initiates the source change generates the XmNvalueChangedCallback. originator-only again, iykyk πŸ’…
    • This callback represents a change in the source in the Text, not in the Text widget.
    • The XmNvalueChangedCallback should occur only in pairs with an XmNmodifyVerifyCallback β€” assuming the doit flag in the callback structure of the XmNmodifyVerifyCallback is not set to False. duo or it didn't happen πŸŽ€
  • XmNvalueWcs β€” the string value of the Text widget as a wchar_t* data value. Moves the cursor to position 0 unless a value of XmNcursorPosition was explicitly supplied in the argument list. wide-char version, same cursor rules ✨
    • > heads up: this resource cannot be specified in a resource file. πŸ™ˆ
    • If XmNvalue and XmNvalueWcs are both defined, the value of XmNvalueWcs supersedes that of XmNvalue. XtGetValues returns a copy of the value of the internal buffer encoded as a wide character string. XtSetValues copies the value of the wide character string into the internal buffer. Wcs stays winning πŸ†
  • XmNverifyBell β€” whether the bell should sound when the verification returns without continuing the action. The default depends on the value of the ancestor VendorShell's XmNaudibleWarning resource. πŸ”” it's giving inherited vibes

XmText Input Resource Set πŸ‘‘

okay so here's the little resource roster, bestie β€” name, class, type, default, access. the whole squad πŸ’œ

  • XmNpendingDelete β€” class XmCPendingDelete, type Boolean, default True, access CSG
  • XmNselectionArray β€” class XmCSelectionArray, type XtPointer, default default array, access CSG
  • XmNselectionArrayCount β€” class XmCSelectionArrayCount, type int, default 4, access CSG
  • XmNselectThreshold β€” class XmCSelectThreshold, type int, default 5, access CSG
  • XmNpendingDelete β€” pending delete mode is on when this Boolean value is True. And what even is pending deletion? glad you asked β€” it's defined as deletion of the selected text when an insertion is made. select, type, gone. periodt πŸ’…
  • XmNselectionArray β€” bestie, this one decides what happens when you click the mouse a bunch of times in a row. πŸ–±οΈ The value is an array of XmTextScanType elements, and XmTextScanType is an enumeration that lists out the possible actions. Every mouse click you do within a certain window of time after the previous click bumps the index into this array up by one and runs the action defined for that index. (That "multiclick" time? It's set by your operating environment, so it varies from system to system. Generally it's some fraction of a second, iykyk.) The possible actions, in the order they show up in the default array, are:
    1. XmSELECT_POSITION, which resets the insert cursor position. ✨
    2. XmSELECT_WORD, which selects a word. πŸŽ€
    3. XmSELECT_LINE, which selects a line of text. This action sees a line as delimited by hard newline characters. In other words, if word wrap is on (XmNwordWrap is True), it will ignore the newlines that the widget inserted automatically. This one is the default. πŸ‘‘
    4. XmSELECT_OUT_LINE, which selects a line of text. This action sees a line as delimited by hard or soft newline characters. In other words, if word wrap is on (XmNwordWrap is True), the newlines the widget inserted automatically will be treated as delimiting lines. πŸ’…
    5. XmSELECT_ALL, which selects all of the text. literally all of it, slay. πŸ”₯
  • XmNselectionArrayCount β€” tells you how many elements live in the XmNselectionArray resource. The value must not be negative. πŸ™…
  • XmNselectThreshold β€” the number of pixels of motion required before it selects the next character when you're selecting in click-drag mode. The value must not be negative. This resource also decides whether a drag should start at all, plus how many pixels it takes to start a drag when Btn2Down and Btn1Down are integrated. πŸ¦‹

✨ XmText Output Resource Set ✨

okay so here's the full roster of output resources, bestie. each one gets its Name, Class, Type, Default, and Access level, no skips:

  • XmNblinkRate β€” Class: XmCBlinkRate, Type: int, Default: 500, Access: CSG
  • XmNcolumns β€” Class: XmCColumns, Type: short, Default: dynamic, Access: CSG
  • XmNcursorPositionVisible β€” Class: XmCCursorPositionVisible, Type: Boolean, Default: True, Access: CSG
  • XmNfontList β€” Class: XmCFontList, Type: XmFontList, Default: dynamic, Access: CSG
  • XmNrenderTable β€” Class: XmCRenderTable, Type: XmRenderTable, Default: dynamic, Access: CSG
  • XmNresizeHeight β€” Class: XmCResizeHeight, Type: Boolean, Default: False, Access: CSG
  • XmNresizeWidth β€” Class: XmCResizeWidth, Type: Boolean, Default: False, Access: CSG
  • XmNrows β€” Class: XmCRows, Type: short, Default: dynamic, Access: CSG
  • XmNwordWrap β€” Class: XmCWordWrap, Type: Boolean, Default: False, Access: CSG

  • XmNblinkRate β€” sets the blink rate of the text cursor, in milliseconds. 🫢 The time in the blink rate relates to both how long the cursor is visible and how long it's invisible β€” meaning 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 0 (zero). The value must not be negative. πŸ’€
  • XmNcolumns β€” sets the initial width of the text window as an integer number of characters. πŸ“ The width equals the number of characters you specify times the width derived from the font you specified. If the em-space value is available, that's what gets used. If it's not, the width of the numeral "0" is used. And if that's not available either, the maximum width is used. With proportionate fonts, the actual number of characters that fit on any given line may be greater than the value you specified. The value must be greater than 0 (zero). The default value depends on the value of the XmNwidth resource β€” and if no width is specified, the default is 20. ✨

When the XmNlayoutDirection resource is XmTOP_TO_BOTTOM, and if the XmText widget resource XmNeditMode is XmSINGLE_LINE_EDIT, this attribute is ignored. If no width is specified, the default is 1.

  • XmNcursorPositionVisible β€” when the Boolean value is True, it means the insert cursor position is marked by a text cursor. πŸŽ€
  • XmNfontList β€” sets the font list used for Text. okay bestie, important: the font list is an obsolete structure and it's kept around only for compatibility with earlier releases of Motif. Use the render table (XmNrenderTable) instead of font lists wherever you possibly can. πŸ™ˆ If you specify both, the render table takes precedence. If this value is NULL at initialization, the widget's parent hierarchy gets searched for an ancestor holding the XmQTspecifyRenderTable trait. If such an ancestor is found, the font list is initialized to the XmTEXT_RENDER_TABLE value of the ancestor widget. If no such ancestor is found, the default is implementation dependent.

Text searches the font list for the first occurrence of a font set that has XmFONTLIST_DEFAULT_TAG. If a default element isn't found, the first font set in the font list gets used. And if the list contains no font sets at all, the first font in the font list gets used. Peep XmFontList(3) for more info on a font list structure. 🌸

  • XmNrenderTable β€” sets the render table used for deriving a font set or font for rendering text. If you specify both a render table and a font list, the render table takes precedence. πŸ‘‘ If the value of XmNrenderTable is NULL at initialization, the widget's parent hierarchy gets searched for an ancestor holding the XmQTspecifyRenderTable trait. If such an ancestor is found, the font list is initialized to the XmTEXT_RENDER_TABLE value of the ancestor widget. If no such ancestor is found, the default is implementation dependent.

Text searches the render table for the first occurrence of a rendition that has the tag _MOTIF_DEFAULT_LOCALE. If a default element isn't found, the first rendition in the table gets used. Peep XmRenderTable(3) for more info on the render table structure. πŸ’œ

  • XmNresizeHeight β€” when the Boolean value is True, it means Text will attempt to resize its height to accommodate all the text contained in the widget. πŸ”₯ And heads up: if the Boolean value is set to True, the text is always displayed, starting from the first position in the source, even if it's instructed otherwise. This attribute is ignored when the application uses a Text widget whose parent is a ScrolledWindow, and when XmNscrollVertical is True.

When the XmNlayoutDirection resource is XmTOP_TO_BOTTOM, this resource means the text attempts to resize its height to accommodate all the text in the widget when the Boolean value is True. This attribute is ignored if XmNwordWrap is True.

  • XmNresizeWidth β€” when the Boolean value is True, it means Text attempts to resize its width to accommodate all the text contained in the widget. This attribute is ignored if XmNwordWrap is True. πŸ¦‹

When the XmNlayoutDirection resource is XmTOP_TO_BOTTOM, this attribute is still effective even if XmNwordWrap is True. Also, this attribute is ignored when the application uses a text widget whose parent is a ScrolledWindow and XmNscrollHorizaontal is True.

  • XmNrows β€” sets the initial height of the text window, measured in character heights. πŸ“ This attribute is ignored if the text widget resource XmNeditMode is XmSINGLE_LINE_EDIT. The value must be greater than 0 (zero). The default value depends on the value of the XmNheight resource β€” and if no height is specified, the default is 1.

When the XmNlayoutDirection resource is XmTOP_TO_BOTTOM, this attribute is still effective, even if the XmText widget resource XmNeditMode is XmSINGLE_LINE_EDIT. If no height is specified, the default is 20. ⭐

  • XmNwordWrap β€” when the Boolean value is True, it means lines get broken at word breaks (that is, the text doesn't go off the right edge of the window). πŸ’– Words are defined as a sequence of characters separated by whitespace, and whitespace is defined as a space, tab, or newline. This attribute is ignored if the text widget resource XmNeditMode is XmSINGLE_LINE_EDIT. Also note: this resource is only valid when the widget is not a scroll one β€” or, if the widget is a scroll widget, when the XmNscrollHorizontal resource is False. πŸ™…

And when the Boolean value is True, it means lines get broken at word breaks (that is, when the XmNlayoutDirection resource is XmTOP_TO_BOTTOM, the text doesn't go off the bottom edge of the window). 🌈

ok so these next ones are the scrolling resources β€” they only wake up and do their thing when your text is chillin' inside a ScrolledWindow. Go peek at the reference page for XmCreateScrolledText if you want the full lore πŸ’…

πŸŒ€ XmText Scrolling Resource Set πŸŒ€

  • XmNscrollHorizontal β€” class XmCScroll, type Boolean, default True, access CG
  • XmNscrollLeftSide β€” class XmCScrollSide, type Boolean, default False, access CG
  • XmNscrollTopSide β€” class XmCScrollSide, type Boolean, default False, access CG
  • XmNscrollVertical β€” class XmCScroll, type Boolean, default True, access CG
bestie listen πŸ‘€ real quick note about that table: if XmNlayoutDirection is XmTOP_TO_BOTTOM, the default is True. yes, actually. that's the plot twist.

  • XmNscrollHorizontal β€” when this Boolean is True, it adds a ScrollBar so your user can scroll sideways through the text. it gets forced to False when the Text widget lives in a ScrolledWindow with XmNscrollingPolicy set to XmAUTOMATIC. also, when XmNlayoutDirection is XmTOP_TO_BOTTOM, this attribute is ignored if the XmText widget resource XmNeditMode is XmSINGLE_LINE_EDIT.
  • XmNscrollLeftSide β€” when this Boolean is True, it means the vertical ScrollBar should sit on the left side of the scrolled text window. this attribute gets ignored if XmNscrollVertical is False, or if the Text resource XmNeditMode is XmSINGLE_LINE_EDIT.

when XmNlayoutDirection is XmTOP_TO_BOTTOM, this resource is still effective, even if the XmText widget resource XmNeditMode is XmSINGLE_LINE_EDIT. yeah. it really said "rules for thee, not for me" ✨

  • XmNscrollTopSide β€” when this Boolean is True, the horizontal ScrollBar gets placed on the top side of the scrolled text window. periodt.

when XmNlayoutDirection is XmTOP_TO_BOTTOM, this attribute is ignored if XmNscrollHorizontal is False or the Xmtext resource XmNeditMode is XmSINGLE_LINE_EDIT.

  • XmNscrollVertical β€” when this Boolean is True, it adds a ScrollBar so your user can scroll up and down through the text. this attribute is ignored if the Text resource XmNeditMode is XmSINGLE_LINE_EDIT. it gets forced to False when the Text widget is placed in a ScrolledWindow with XmNscrollingPolicy set to XmAUTOMATIC.

when XmNlayoutDirection is XmTOP_TO_BOTTOM, this resource is still effective, even if the XmText widget resource XmNeditMode is XmSINGLE_LINE_EDIT. πŸ’…


🧬 Inherited Resources 🧬

Text is literally inheriting behavior and resources from its superclasses like the icon it is β€” tables below, bestie. for a complete description of each resource, go read the reference page for that superclass. i'm just the messenger 🫢

✨ XmPrimitive Resource Set ✨

  • XmNbottomShadowColor β€” class XmCBottomShadowColor, type Pixel, default dynamic, access CSG
  • XmNbottomShadowPixmap β€” class XmCBottomShadowPixmap, type Pixmap, default XmUNSPECIFIED_PIXMAP, access CSG
  • XmNconvertCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • 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
  • XmNhighlightOnEnter β€” class XmCHighlightOnEnter, type Boolean, default False, access CSG
  • XmNhighlightPixmap β€” class XmCHighlightPixmap, type Pixmap, default dynamic, access CSG
  • XmNhighlightThickness β€” class XmCHighlightThickness, type Dimension, default 2, access CSG
  • XmNlayoutDirection β€” class XmCLayoutDirection, type XmDirection, default dynamic, access CG
  • XmNnavigationType β€” class XmCNavigationType, type XmNavigationType, default XmTAB_GROUP, access CSG
  • XmNpopupHandlerCallback β€” class XmCCallback, type XtCallbackList, default NULL, access C
  • XmNshadowThickness β€” class XmCShadowThickness, type Dimension, default 2, access CSG
  • XmNtopShadowColor β€” class XmCTopShadowColor, type Pixel, default dynamic, access CSG
  • XmNtopShadowPixmap β€” class XmCTopShadowPixmap, type Pixmap, default dynamic, access CSG
  • XmNtraversalOn β€” class XmCTraversalOn, type Boolean, default True, access CSG
  • XmNunitType β€” class XmCUnitType, type unsigned char, default dynamic, access CSG
  • XmNuserData β€” class XmCUserData, type XtPointer, default NULL, access CSG

🌈 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 πŸ“ž

so every single callback gets handed a pointer to this lil structure, okay? here it is:

typedef struct
{
        int reason;
        XEvent * event;
} XmAnyCallbackStruct;
  • reason β€” tells you why the callback got invoked. the whole motive, the backstory πŸ”
  • event β€” points to the XEvent that triggered the callback. the moment that started it all ✨

and NOW πŸ’– the Text widget also defines a whole new callback structure for use with verification callbacks. heads up though: not all fields are relevant for every callback reason. the application has to look at the reason field first and only use the structure members that are actually valid for that particular reason. don't be out here reading fields that aren't yours bestie πŸ™ˆ

the values startPos, endPos, and text in the callback structure XmTextVerifyCallbackStruct may be modified when the callback is received β€” and those changes will be reflected as changes made to the source of the Text widget. (for example, all keystrokes can be converted to spaces or NULL characters when a password is entered into a Text widget. iconic behavior honestly.) but the application programmer should not overwrite the text field β€” instead, attach data to that pointer. do not touch. just vibe.

so this next structure gets handed to callbacks for XmNlosingFocusCallback, XmNmodifyVerifyCallback, and XmNmotionVerifyCallback:

typedef struct
{
        int reason;
        XEvent * event;
        Boolean doit;
        XmTextPosition currInsert, newInsert;
        XmTextPosition startPos, endPos;
        XmTextBlock text;
} XmTextVerifyCallbackStruct, *XmTextVerifyPtr;
  • reason β€” tells you why the callback was invoked πŸ•΅οΈ
  • event β€” points to the XEvent that triggered the callback. it can be NULL. for example, changes made to the Text widget programmatically don't have an event that can be passed to the associated callback. no event, no problem, no drama πŸ’…
  • doit β€” the vibe check for whether the action that summoned the callback actually goes through. Set doit to False and boom, the action is negated. But bestie, not every action can be cancelled like that. For example, XmCR_LOSING_FOCUS callbacks? If they're produced by mouse clicks, they might be totally beyond the widget's control. 😭
  • currInsert β€” shows where the insert cursor is right now. Current location, periodt. πŸ’…
  • newInsert β€” where the user is trying to move that insert cursor to. Ambition.
  • startPos β€” the starting position of the text to modify. If this callback isn't a modify verification callback, it's literally the same as currInsert.
  • endPos β€” the ending position of the text to modify. If no text is replaced or deleted, it's the same as startPos. And if this callback isn't a modify verification callback, it's the same as currInsert. Matching energy.
  • text β€” points to a structure of type XmTextBlockRec. This holds the textual information that's about to be inserted.
       typedef struct
       {
               char *ptr;
               int length;
               XmTextFormat format;
       } XmTextBlockRec, *XmTextBlock;
  • ptr β€” points to the text to be inserted.
  • length β€” specifies the length of the text to be inserted.
  • format β€” specifies the format of the text, either XmFMT_8_BIT or XmFMT_16_BIT.

A pointer to the following structure is passed to callbacks for XmNmodifyVerifyCallbackWcs.

       typedef struct
       {
               int reason;
               XEvent *event;
               Boolean doit;
               XmTextPosition currInsert, newInsert;
               XmTextPosition startPos, endPos;
               XmTextBlockWcs text;
       } XmTextVerifyCallbackStructWcs, *XmTextVerifyPtrWcs;
  • reason β€” why the callback was invoked. The reason era. ✨
  • event β€” points to the XEvent that triggered the callback. It can be NULL. For example, changes made to the Text widget programmatically don't have an event that can be passed to the associated callback. No event, no problem.
  • doit β€” same deal as before: whether the action that invoked the callback is performed. Setting doit to False negates the action. But again, not all actions may be negated. For example, XmCR_LOSING_FOCUS callbacks may be beyond the control of the widget if they are produced by mouse clicks. πŸ’€
  • currInsert β€” the current position of the insert cursor.
  • newInsert β€” the position at which the user attempts to position the insert cursor.
  • startPos β€” the starting position of the text to modify. If the callback is not a modify verification callback, this value is the same as currInsert.
  • endPos β€” the ending position of the text to modify. If no text is replaced or deleted, the value is the same as startPos. If the callback is not a modify verification callback, this value is the same as currInsert.
  • text β€” points to the following structure of type XmTextBlockRecWcs. This structure holds the textual information to be inserted.
       typedef struct
       {
               wchar_t *wcsptr;
               int length;
       } XmTextBlockRecWcs, *XmTextBlockWcs;
  • wcsptr β€” points to the wide character text to be inserted.
  • length β€” specifies the number of characters to be inserted.

The following table describes the reasons for which the individual verification callback structure fields are valid. Note that the event field will never be valid for XmCR_MOVING_INSERT_CURSOR.

  • XmCR_LOSING_FOCUS β€” valid fields: reason, event, doit, currInsert, newInsert, startPos, endPos
  • XmCR_MODIFYING_TEXT_VALUE β€” valid fields: reason, event, doit, currInsert, newInsert, startPos, endPos, text
  • XmCR_MOVING_INSERT_CURSOR β€” valid fields: reason, doit, currInsert, newInsert

A pointer to the following callback structure is passed to the XmNdestinationCallback procedures:

       typedef struct
       {
               int reason;
               XEvent  *event;
               Atom selection;
               XtEnum operation;
               int flags;
               XtPointer transfer_id;
               XtPointer destination_data;
               XtPointer location_data;
               Time time;
       } XmDestinationCallbackStruct;
  • reason β€” indicates why the callback was invoked.
  • event β€” points to the XEvent that triggered the callback. It can be NULL.
  • selection β€” indicates the selection for which data transfer is being requested. Possible values are CLIPBOARD, PRIMARY, SECONDARY, and _MOTIF_DROP.
  • operation β€” indicates the type of transfer operation requested.
    • When the selection is PRIMARY or SECONDARY, possible values are XmMOVE, XmCOPY, and XmLINK.
    • When the selection is CLIPBOARD, possible values are XmCOPY and XmLINK.
    • When the selection is _MOTIF_DROP, possible values are XmMOVE, XmCOPY, XmLINK, and XmOTHER. A value of XmOTHER means that the callback procedure must get further information from the XmDropProcCallbackStruct structure in the destination_data member.
  • flags β€” indicates whether or not the destination widget is also the source of the data to be transferred. Possible values:
    • XmCONVERTING_NONE β€” the destination widget is not the source of the data to be transferred.
    • XmCONVERTING_SAME β€” the destination widget is the source of the data to be transferred.
  • transfer_id β€” serves as a unique ID to identify the transfer transaction. It's giving transaction passport. πŸ›‚
  • destination_data β€” contains information about the destination. When the selection is _MOTIF_DROP, the callback procedures are called by the drop site's XmNdropProc, and destination_data is a pointer to the XmDropProcCallbackStruct structure passed to the XmNdropProc procedure. When the selection is SECONDARY, destination_data is an Atom representing a target recommmended by the selection owner for use in converting the selection. Otherwise, destination_data is NULL.
  • location_data β€” contains information about the location where data is to be transferred. The value is always NULL when the selection is CLIPBOARD. If the value is NULL, the data is to be inserted at the widget's cursor position. Otherwise, the value is a pointer to an XPoint structure containing the x- and y-coordinates at the location where the data is to be transferred. Once XmTransferDone procedures start to be called, location_data will no longer be stable. So don't get attached, bestie. 🫠
  • time β€” indicates the time when the transfer operation began.

✨ Translations ✨

The XmText translations are described in the following list. The actions represent the effective behavior of the associated events, and they may differ in a right-to-left language environment.

The following key names are listed in the X standard key event translation table syntax. This format is the one used by Motif to specify the widget actions corresponding to a given key. A brief overview of the format is provided under VirtualBindings(3). For a complete description of the format, please refer to the X Toolkit Instrinsics Documentation.

  • ∼c s ∼m ∼a <Btn1Down>: extend-start()
  • c ∼s ∼m ∼a <Btn1Down>: move-destination()
  • ∼c ∼s ∼m ∼a <Btn1Down>: grab-focus()
  • ∼c ∼m ∼a <Btn1Motion>: extend-adjust()
  • ∼c ∼m ∼a <Btn1Up>: extend-end()
  • <Btn2Down>: process-bdrag()
  • m ∼a <Btn2Motion>: secondary-adjust()
  • ∼m a <Btn2Motion>: secondary-adjust()
  • s c <Btn2Up>: link-to()
  • ∼s <Btn2Up>: copy-to()
  • ∼c <Btn2Up>: move-to()
  • :m <Key><osfPrimaryPaste>: cut-primary()
  • :a <Key><osfPrimaryPaste>: cut-primary()
  • :<Key><osfPrimaryPaste>: copy-primary()
  • :m <Key><osfCut>: cut-primary()
  • :a <Key><osfCut>: cut-primary()
  • :<Key><osfCut>: cut-clipboard()
  • :<Key><osfPaste>: paste-clipboard()
  • :m <Key><osfCopy>: copy-primary()
  • :a <Key><osfCopy>: copy-primary()
  • :<Key><osfCopy>: copy-clipboard()
  • :s c <Key><osfBeginLine>: beginning-of-file(extend)
  • :c <Key><osfBeginLine>: beginning-of-file()
  • :s <Key><osfBeginLine>: beginning-of-line(extend)
  • :<Key><osfBeginLine>: beginning-of-line()
  • :s c <Key><osfEndLine>: end-of-file(extend)
  • :c <Key><osfEndLine>: end-of-file()
  • :s <Key><osfEndLine>: end-of-line(extend)
  • :<Key><osfEndLine>: end-of-line()
  • :s <Key><osfPageLeft>: page-left(extend) (ignored in vertical writing)
  • :<Key><osfPageLeft>: page-left() (next-page() in vertical writing)
  • :s c <Key><osfPageUp>: page-left(extend)
  • :c <Key><osfPageUp>: page-left()
  • :s <Key><osfPageUp>: previous-page(extend) (ignored in vertical writing)
  • :<Key><osfPageUp>: previous-page() (page-up() in vertical writing)
  • :s <Key><osfPageRight>: page-right(extend) (ignored in vertical writing)
  • :<Key><osfPageRight>: page-right() (previous-page() in vertical writing)
  • s c <Key><osfPageDown>: page-right(extend) (ignored in vertical writing)
  • :c <Key><osfPageDown>: page-right()
  • :s <Key><osfPageDown>: next-page(extend) (ignored in vertical writing)
  • :<Key><osfPageDown>: next-page() (page-down() in vertical writing)
  • :<Key><osfClear>: clear-selection()
:<Key><osfBackSpace>:
          delete-previous-character()

:s m <Key><osfDelete>:
          cut-primary()

:s a <Key><osfDelete>:
          cut-primary()

:s <Key><osfDelete>:
          cut-clipboard()

:c <Key><osfDelete>:
          delete-to-end-of-line()

:<Key><osfDelete>:
          delete-next-character()

:c m <Key><osfInsert>:
          copy-primary()

:c a <Key><osfInsert>:
          copy-primary()

:s <Key><osfInsert>:
          paste-clipboard()

:c <Key><osfInsert>:
          copy-clipboard()

:s <Key><osfSelect>:
          key-select()

:<Key><osfSelect>:
          set-anchor()

:<Key><osfSelectAll>:
          select-all()

:<Key><osfDeselectAll>:
          deselect-all()

:<Key><osfActivate>:
          activate()

:<Key><osfAddMode>:
          toggle-add-mode()

:<Key><osfHelp>:
          Help()

:<Key><osfCancel>:
          process-cancel()

:s c <Key><osfLeft>:
          backward-word(extend) ( forward-paragraph(extend) in vertical
          writing)

:c <Key><osfLeft>:
          backward-word() (forward-paragraph() in vertical writing)

:s <Key><osfLeft>:
          key-select(left) (process-shift-left() in vertical writing)

:<Key><osfLeft>:
          backward-character() (process-left() in vertical writing)

:s c <Key><osfRight>:
          forward-word(extend) (backward-paragraph(extend) in vertical
          writing)

:c <Key><osfRight>:
          forward-word() (backward-paragraph() in vertical writing)

:s <Key><osfRight>:
          key-select(right) (process-shift-right in vertical writing)

:<Key><osfRight>:
          forward-character() (process-right() in vertical writing)

:s c <Key><osfUp>:
          backward-paragraph(extend) (backward-word(extend) in vertical
          writing)

:c <Key><osfUp>:
          backward-paragraph() (backward-word() in vertical writing)

:s <Key><osfUp>:
          process-shift-up() (key-select(up) in vertical writing)

:<Key><osfUp>:
          process-up() (backward-character() in vertical writing)

:s c <Key><osfDown>:
          forward-paragraph(extend) (forward-word(extend) in vertical
          writing)

:c <Key><osfDown>:
          forward-paragraph() (forward-word() in vertical writing)

:s <Key><osfDown>:
          process-shift-down() (key-select(down) in vertical writing)

:<Key><osfDown>:
          process-down() (forward-character() in vertical writing)

c ∼m ∼a <Key>slash:
          select-all()

c ∼m ∼a <Key>backslash:
          deselect-all()

s c ∼m ∼a <Key>Tab:
          prev-tab-group()

∼s c ∼m ∼a <Key>Tab:
          next-tab-group()

s ∼c ∼m ∼a <Key>Tab:
          process-tab(Prev)

∼s ∼c ∼m ∼a <Key>Tab:
          process-tab(Next)

∼s c ∼m ∼a <Key>Return:
          activate()

∼s ∼c ∼m ∼a <Key>Return:
          process-return()

∼s c ∼m ∼a <Key>space:
          set-anchor()

s c ∼m ∼a <Key>space:
          key-select()

s ∼c ∼m ∼a <Key>space:
          self-insert()

<Key>:    self-insert()

Okay so here's the tea, bestie πŸ’– β€” the Text button event translations get a glow-up when Display's XmNenableBtn1Transfer resource doesn't have a value of XmOFF (aka it's either XmBUTTON2_TRANSFER or XmBUTTON2_ADJUST). This option lets the actions for selection and transfer get integrated on <Btn1>, and the actions for extending the selection can be bound to <Btn2>. The <Btn1> actions we defined up there still apply when the <Btn1> event happens over text that is not selected. But the following actions apply when the <Btn1> event happens over text that is selected:

<Btn1Down>:
          process-bdrag().

<Shift><Btn1Down>:
          process-bdrag().

<Ctrl><Btn1Down>:
          process-bdrag().

<Btn1Down><Shift><Btn1Up>:
          grab-focus(), extend-end.

<Shift><Btn1Down><Shift><Btn1Up>:
          extend-start(), extend-end().

<Ctrl><Btn1Down><Shift><Btn1Up>:
          move-destination().

And when Display's XmNenableBtn1Transfer resource has a value of XmBUTTON2_ADJUST, these are the ones that apply:

<Btn2Down>:
          extend-start().

<Btn2Motion>:
          extend-adjust().

<Btn2Up>: extend-end().

✨ Action Routines ✨

The XmText action routines are, like, the whole roster. Here's the lineup πŸ‘‘

  • activate() β€” Calls the callbacks for XmNactivateCallback. Passes the event to the parent.
  • backward-character(extend) β€” Moves the insertion cursor one character to the left. Heads up: this action may have different behavior in a right-to-left language environment.

If you call it with an argument of extend, it moves the insertion cursor just like the no-argument case and extends the current selection.

The backward-character() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If called with the extend argument, the backward-character() action may produce calls to the XmNgainPrimaryCallback procedures. See callback description for more info.

In vertical writing, if XmNeditMode is XmSINGLE_LINE_EDIT and XmNnavigationType is XmNONE, it traverses to the widget to the left in the tab group. If XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor to the next line in the same column.

  • backward-paragraph(extend) β€” If XmNeditMode is XmMULTI_LINE_EDIT and 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 the beginning of the text. And if the insertion cursor is already at the beginning of a paragraph, it moves the insertion cursor to the beginning of the previous paragraph. ✨

If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with an argument of extend, it moves the insertion cursor like the no-argument case and extends the current selection.

The backward-paragraph() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If called with the extend argument, the backward-paragraph() action may produce calls to the XmNgainPrimaryCallback procedures. See callback description for more info.

  • backward-word(extend) β€” If this action is called with 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, it 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.

If called with an argument of extend, it moves the insertion cursor like the no-argument case and extends the current selection.

The backward-word() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If called with the extend argument, the backward-word() action may produce calls to the XmNgainPrimaryCallback procedures. See callback description for more info.

  • beep() β€” Causes the terminal to beep. That's it, that's the whole job. The beep() action produces no callbacks. Iconic, honestly.
  • beginning-of-file(extend) β€” If this action is called with no argument, it moves the insertion cursor to the beginning of the text.

If called with an argument of extend, it moves the insertion cursor like the no-argument case and extends the current selection.

The beginning-of-file() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If called with the extend argument, the beginning-of-file() action may produce calls to the XmNgainPrimaryCallback procedures. See callback description for more info.

  • beginning-of-line(extend) β€” If this action is called with no argument, it moves the insertion cursor to the beginning of the line.

If called with an argument of extend, it moves the insertion cursor like the no-argument case and extends the current selection.

The beginning-of-line() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If called with the extend argument, the beginning-of-line() action may produce calls to the XmNgainPrimaryCallback procedures. See callback description for more info.

  • clear-selection() β€” Clears the current selection by replacing each character except <Return> with a <space> character.

The clear-selection() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED.

  • copy-clipboard() β€” If this widget owns the primary selection, this action copies the selection to the clipboard. It calls the XmNconvertCallback procedures, possibly multiple times, for the CLIPBOARD selection. πŸ¦‹
  • copy-primary() β€” Copies the primary selection to just before the insertion cursor. This action calls the XmNdestinationCallback procedures for the PRIMARY selection and the XmCOPY operation. It also calls the selection owner's XmNconvertCallback procedures, possibly multiple times, for the PRIMARY selection.

On top of all that, the copy-primary() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, to the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. So many callbacks, she's booked and busy πŸ’…

copy-to() πŸŽ€

okay so bestie, if a secondary selection exists, this one copies that secondary selection over to the insertion position of the destination component. and if the primary selection happens to be in the destination widget? it gets deselected. if not, literally no effect on the primary selection, she's fine, she's unbothered. πŸ’…

here's the callback tea:

  • it calls the destination's XmNdestinationCallback procedures for the SECONDARY</> selection and the XmCOPY operation.
  • the destination's XmNdestinationCallback procedures or the destination component itself invokes the selection owner's XmNconvertCallback procedures, possibly multiple times, for the SECONDARY</> selection.

but wait β€” if there's no secondary selection at all, then she copies the primary selection to the pointer position instead. in that case:

  • it calls the XmNdestinationCallback procedures for the PRIMARY</> selection and the XmCOPY operation.
  • it calls the selection owner's XmNconvertCallback procedures, possibly multiple times, for the PRIMARY</> selection.

and on top of all that, copy-to() also produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, to the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. oh and if there's no secondary selection, copy-to() may produce calls to the XmNgainPrimaryCallback procedures. see the callback description for more info, iykyk. ✨


cut-clipboard() βœ‚οΈ

if this widget owns the primary selection, this action cuts the selection to the clipboard. slay.

  • it calls the XmNconvertCallback procedures, possibly multiple times, for the CLIPBOARD selection.
  • if the transfer is successful, it then calls the XmNconvertCallback procedures for the CLIPBOARD selection and the DELETE target. πŸ”₯

plus, cut-clipboard() produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED.


cut-primary() πŸ’œ

cuts the primary selection and pastes it just before the insertion cursor. main character move honestly.

  • it calls the XmNdestinationCallback procedures for the PRIMARY</> selection and the XmMOVE operation.
  • it calls the selection owner's XmNconvertCallback procedures, possibly multiple times, for the PRIMARY</> selection.
  • if the transfer is successful, it then calls the selection owner's XmNconvertCallback procedures for the PRIMARY</> selection and the DELETE target.
  • cut-primary() may produce calls to the XmNgainPrimaryCallback procedures. see the callback description for more info. 🫢

and also, cut-primary() produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR, the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED.


delete-next-character() 🌸

in normal mode: if there's a nonnull selection, deletes the selection; otherwise, deletes the character following the insertion cursor.

in add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it deletes the character following the insertion cursor.

heads up bestie β€” this may impact the selection. 😭

the delete-next-character() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED.


delete-next-word() 🌈

in normal mode: if there's a nonnull selection, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next space, tab or end-of-line character.

in add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it deletes the characters following the insertion cursor to the next space, tab or end-of-line character.

this may impact the selection, and also β€” this action may have different behavior in a locale other than the C locale. so like, don't be surprised ok?? πŸ’€

the delete-next-word() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED.


delete-previous-character() πŸ“

in normal mode: if there's a nonnull selection, deletes the selection; otherwise, deletes the character of text immediately preceding the insertion cursor.

in add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it deletes the character of text immediately preceding the insertion cursor.

this may impact the selection. πŸ™ˆ

the delete-previous-character() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


delete-previous-word() πŸ¦‹

in normal mode: if there's a nonnull selection, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the next space, tab or beginning-of-line character.

in add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it deletes the characters preceding the insertion cursor to the next space, tab or beginning-of-line character.

this may impact the selection. and same energy as before β€” this action may have different behavior in a locale other than the C locale. ✨

the delete-previous-word() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


delete-selection() πŸ”₯

deletes the current selection. that's it, that's the whole vibe. iconic.

the delete-selection() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


delete-to-end-of-line() πŸ‘‘

in normal mode: if there's a nonnull selection, deletes the selection; otherwise, deletes the characters following the insertion cursor to the next end of line character.

in add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it deletes the characters following the insertion cursor to the next end of line character.

this may impact the selection, no cap. πŸ’…

the delete-to-end-of-line() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED.


delete-to-start-of-line() ⭐

in normal mode: if there's a nonnull selection, deletes the selection; otherwise, deletes the characters preceding the insertion cursor to the previous beginning-of-line character.

in add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it deletes the characters preceding the insertion cursor to the previous beginning-of-line character.

this may impact the selection. fr fr. 😭

the delete-to-start-of-line() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


deselect-all() 🧚

deselects the current selection. and like… that's it. the deselect-all() action produces no callbacks. she's lowkey the chillest one here. periodt. πŸ’œ


end-of-file(extend) πŸŽ€

if this action is called with no argument, it moves the insertion cursor to the end of the text.

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

the end-of-file() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. and if it's called with the extend argument, the end-of-file() action may produce calls to the XmNgainPrimaryCallback procedures. see the callback description for more info. 🫢


end-of-line(extend) ✨

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

the end-of-line() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. and if it's called with the extend argument, the end-of-line() action may produce calls to the XmNgainPrimaryCallback procedures. see the callback description for more info. 🌸

  • extend-adjust() β€” takes the text from the anchor alllll the way over to wherever your pointer is sitting, and deselects everything outside that range. And the way it handles dragging across multiple lines? iconic. It selects from the anchor to the end of every line the pointer moves over, and up to the pointer position on the current line.

This one calls the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. It may also call the XmNgainPrimaryCallback procedures. Check the callback description for the whole story.

  • extend-end() β€” moves the insertion cursor to the pointer's position. This is the one you use to commit the selection, bestie. Once it's run, process-cancel() can't cancel the selection anymore. It's locked in, periodt.

extend-end() calls the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. It may also call the XmNgainPrimaryCallback procedures. See the callback description for more info.

  • extend-start() β€” adjusts the anchor using the balance-beam method. Selects text from the anchor to the pointer position and deselects anything outside that range. extend-start() may produce no callbacks at all, but it may also call the XmNgainPrimaryCallback procedures. Callback description, go read it.
  • forward-character(extend) β€” nudges the insertion cursor one character to the right. Heads up though, this action may act different in a right-to-left language environment. πŸ™ˆ

Call it with an argument of extend and it moves the insertion cursor exactly like the no-argument case and extends the current selection. Two birds, one cursor.

forward-character() calls the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. Called with the extend argument, it may also call the XmNgainPrimaryCallback procedures. Callback description has the details.

In vertical writing: if XmNeditMode is XmSINGLE_LINE_EDIT and XmNnavigationType is XmNONE, it traverses to the widget on the right in the tab group. If XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor to the previous line in the same column. Slay.

  • forward-paragraph(extend) β€” if XmNeditMode is XmMULTI_LINE_EDIT and you call it with no argument, it moves the insertion cursor to the first non-whitespace character after the next blank line. Already chilling at the beginning of a paragraph? Then it moves the insertion cursor to the beginning of the next paragraph. Main character behavior.

If XmNeditMode is XmMULTI_LINE_EDIT and you call it with an argument of extend, it moves the insertion cursor just like the no-argument case and extends the current selection.

forward-paragraph() calls the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. With the extend argument, it may also call the XmNgainPrimaryCallback procedures. Callback description, bestie.

  • forward-word(extend) β€” no argument? It 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 sitting at the end of a word, it hops to the end of the next word. Fair warning: this action may behave differently in a locale other than the C locale.

Called with an argument of extend, it moves the insertion cursor exactly like the no-argument case and extends the current selection.

forward-word() calls the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. With the extend argument, it may also call the XmNgainPrimaryCallback procedures. See the callback description for more.

  • grab-focus() β€” this key binding does whatever the XmNselectionArray says to do, depending on how many times you clicked that mouse. Default selection array ordering, fr fr: one click moves the insertion cursor to the pointer position, two clicks select a word, three clicks select a line of text, four clicks select all the text. And a single click also deselects any selected text and drops the anchor at the pointer position. This action may act different in a locale other than the C locale. πŸ–±οΈ

grab-focus() calls the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

  • Help() β€” calls the callbacks for XmNhelpCallback if any of them exist. If this widget has no help callbacks, it goes and calls the help callbacks on the nearest ancestor that has them. family support energy. 🫢
  • insert-string(string) β€” if XmNpendingDelete is True and the cursor is not disjoint from the current selection, it deletes the entire selection. Then it inserts string before the insertion cursor. No notes.

insert-string() calls the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. Now, plot twist: with an empty string, no callbacks get called, because nothing actually got modified. BUT β€” if the insertion position is inside the current selection, insert-string with an empty string will cause the selection to be deselected, and the XmNmotionVerifyCallback procedures to be called with reason values XmCR_MOVING_INSERT_CURSOR, XmCR_MODIFYING_TEXT_VALUE, and XmCR_VALUE_CHANGED. The way that empty string is doing the most. πŸ’€

  • key-select(right|left) β€” called with an argument of right, it moves the insertion cursor one character to the right and extends the current selection. Called with left, it moves the insertion cursor one character to the left and extends the current selection. Called with no argument at all? It just extends the current selection. Simple as.

Lowkey important: after a key-select action, the selection still begins at the original anchor, and extends to the position indicated in the action call. If this new position lands on the opposite side of the selection anchor from the previous selection boundary, the original selection gets deselected. bye.

key-select() calls the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. It may also call the XmNgainPrimaryCallback procedures. See the callback description for more.

In vertical writing: called with the argument left and if XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor to the next line in the same column. Called with the argument right and if XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor to the previous line in the same column.

  • kill-next-character() β€” in normal mode: if there's a nonnull selection, it kills the selection; otherwise it kills the character following the insertion cursor and stores that character in the cut buffer. In add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise it kills the character following the insertion cursor and stores the character in the cut buffer. Heads up, this may impact the selection. 😭

The killed text gets stored in CUT_BUFFER0.

kill-next-character() calls the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

  • kill-next-word() β€” in normal mode: if there's a nonnull selection, it deletes the selection; otherwise it kills the characters following the insertion cursor up to the next space, tab or end-of-line character, and stores those characters in the cut buffer. In add mode: if there's a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise it kills the characters following the insertion cursor up to the next space, tab or end-of-line character, and stores the characters in the cut buffer. This may impact the selection. And this action may behave differently in a locale other than the C locale.

The killed text gets stored in CUT_BUFFER0.

kill-next-word() calls the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

kill-previous-character() πŸ’–

In normal mode, if there is a nonnull selection, it deletes the selection; otherwise, it kills the character immediately preceding the insertion cursor and stores the character in the cut buffer.

In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it kills the character immediately preceding the insertion cursor and stores the character in the cut buffer. This may impact the selection.

The killed text is stored in CUT_BUFFER0.

The kill-previous-character() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


kill-previous-word() ✨

In normal mode, if there is a nonnull selection, it deletes the selection; otherwise, it kills the characters preceding the insertion cursor up to the next space, tab or beginning-of-line character, and stores the characters in the cut buffer.

In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it kills the characters preceding the insertion cursor up to the next space, tab or beginning-of-line character, and stores the characters in the cut buffer. This may impact the selection. This action may have different behavior in a locale other than the C locale.

The killed text is stored in CUT_BUFFER0.

The kill-previous-word() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


kill-selection() πŸŽ€

Kills the currently selected text and stores the text in the cut buffer.

The killed text is stored in CUT_BUFFER0.

The kill-selection() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


kill-to-end-of-line() 🌸

In normal mode, if there is a nonnull selection, it deletes the selection; otherwise, it kills the characters following the insertion cursor to the next end-of-line character and stores the characters in the cut buffer.

In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it kills the characters following the insertion cursor to the next end of line character and stores the characters in the cut buffer. This may impact the selection.

The killed text is stored in CUT_BUFFER0.

The kill-to-end-of-line() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED. In the case where there is a non-null selection to be deleted, this action may also produce calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


kill-to-start-of-line() πŸ’…

In normal mode, if there is a nonnull selection, it deletes the selection; otherwise, it kills the characters preceding the insertion cursor to the next beginning-of-line character and stores the characters in the cut buffer.

In add mode, if there is a nonnull selection, the cursor is not disjoint from the selection, and XmNpendingDelete is set to True, it deletes the selection; otherwise, it kills the characters preceding the insertion cursor to the next beginning-of-line character and stores the characters in the cut buffer. This may impact the selection.

The killed text is stored in CUT_BUFFER0.

The kill-to-start-of-line() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


Places a link to the primary selection just before the insertion cursor. This action calls the XmNdestinationCallback procedures for the PRIMARY selection and the XmLINK operation. The Text widget itself performs no transfers; the XmNdestinationCallback procedures are responsible for inserting the link to the primary selection and for taking any related actions.


If a secondary selection exists, this action places a link to the secondary selection at the insertion position of the destination component. This action calls the destination's XmNdestinationCallback procedures for the SECONDARY selection and the XmLINK operation.

If no secondary selection exists, this action places a link to the primary selection at the pointer position. This action calls the XmNdestinationCallback procedures for the PRIMARY selection and the XmLINK operation.

The Text widget itself performs no transfers; the XmNdestinationCallback procedures are responsible for inserting the link to the primary or secondary selection and for taking any related actions.


move-destination() 🫢

Moves the insertion cursor to the pointer position without changing any existing current selection. If there is a current selection, sets the widget as the destination widget. This also moves the widget focus to match the insertion cursor.

The move-destination() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


move-to() πŸš€

If a secondary selection exists, this action moves the secondary selection to the insertion position of the destination component. If the secondary selection is in the destination widget, and the secondary selection and the primary selection overlap, the result is undefined. This action calls the destination's XmNdestinationCallback procedures for the SECONDARY selection and the XmMOVE operation. The destination's XmNdestinationCallback procedures or the destination component itself invokes the selection owner's XmNconvertCallback procedures, possibly multiple times, for the SECONDARY selection. If the transfer is successful, this action then calls the selection owner's XmNconvertCallback procedures for the SECONDARY selection and the DELETE target.

If no secondary selection exists, this action moves the primary selection to the pointer position. This action calls the XmNdestinationCallback procedures for the PRIMARY selection and the XmMOVE operation. It calls the selection owner's XmNconvertCallback procedures, possibly multiple times, for the PRIMARY selection. If the transfer is successful, this action then calls the selection owner's XmNconvertCallback procedures for the PRIMARY selection and the DELETE target.

The move-to() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If there is no secondary selection, the move-to() action may produce calls to the XmNgainPrimaryCallback procedures. See callback description for more information.


newline() 🌈

If XmNpendingDelete is True and the cursor is not disjoint from the current selection, it deletes the entire selection. Inserts a newline before the insertion cursor.

The newline() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


newline-and-backup() ⭐

If XmNpendingDelete is True and the cursor is not disjoint from the current selection, it 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.

The newline-and-backup() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED.


newline-and-indent() πŸ‘‘

If XmNpendingDelete is True and the cursor is not disjoint from the current selection, it deletes the entire selection. Inserts a newline and then the same number of whitespace characters as at the beginning of the previous line.

The newline-and-indent() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


next-line() πŸ’œ

Moves the insertion cursor to the next line.

The next-line() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.


πŸ¦‹ next-page(extend)

  • If XmNeditMode is XmMULTI_LINE_EDIT and you call this one with no argument, it moves the insertion cursor forward one page. Just vibing forward, page by page bestie πŸ’…
  • If XmNeditMode is XmMULTI_LINE_EDIT and you call it with an argument of extend, it moves the insertion cursor exactly like the no-argument case and extends the current selection. Selection glow-up, we love to see it ✨

The next-page() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If it's called with the extend argument, the next-page() action may also produce calls to the XmNgainPrimaryCallback procedures. Go peek at the callback description for more info, iykyk 🫢

In <b>vertical writing</b>, it scrolls the viewing window down one page of text. Down we gooo 🌸

🧚 next-tab-group()

Traverses to the next tab group. So iconic, so organized πŸ‘‘

The next-tab-group() action produces no callbacks, unless it results in the widget losing focus β€” in which case the XmNlosingFocusCallback procedures are called with reason value XmCR_LOSING_FOCUS. Sorry girl, focus said bye 😭

πŸ’œ page-left(extend)

  • If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with no argument, it moves the insertion cursor back one page.
  • If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with an argument of extend, it moves the insertion cursor just like the no-argument case and extends the current selection.

The page-left() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If it's called with the extend argument, the page-left() action may produce calls to the XmNgainPrimaryCallback procedures. Callback description has the deets, go read it bestie πŸ“–

🌈 page-right(extend)

  • If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with no argument, it moves the insertion cursor forward one page.
  • If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with an argument of extend, it moves the insertion cursor just like the no-argument case and extends the current selection.

The page-right() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If it's called with the extend argument, the page-right() action may produce calls to the XmNgainPrimaryCallback procedures. See the callback description for more information πŸ’–

πŸŽ€ paste-clipboard()

Pastes the contents of the clipboard before the insertion cursor. This action calls the XmNdestinationCallback procedures for the CLIPBOARD selection and the XmCOPY operation. Copy-paste era, we stan πŸ“

The paste-clipboard() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. Three callbacks at once? She's doing the most and honestly she ate πŸ’…

πŸ¦‹ prev-tab-group()

Traverses to the previous tab group. Backwards but make it fashion ✨

The prev-tab-group() action produces no callbacks, unless it results in the widget losing focus β€” in which case the XmNlosingFocusCallback procedures are called with reason value XmCR_LOSING_FOCUS.

⭐ previous-line()

Moves the insertion cursor to the previous line. Up up and away 🌸

The previous-line() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

πŸ’« previous-page(extend)

  • If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with no argument, it moves the insertion cursor back one page.
  • If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with an argument of extend, it moves the insertion cursor just like the no-argument case and extends the current selection.

The previous-page() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. If it's called with the extend argument, the previous-page() action may produce calls to the XmNgainPrimaryCallback procedures. See the callback description for more information 🫢

In <b>vertical writing</b>, if it's called without an argument, it scrolls the viewing window up one page of text. Scroll up bestie, we're going back ⬆️

πŸ‘‘ process-bdrag()

If the pointer is within the selection, this action starts a drag operation for the selection. This action sets the XmNconvertProc of the DragContext to a function that calls the XmNconvertCallback procedures, possibly multiple times, for the _MOTIF_DROP selection. Multiple times! She's thorough, periodt πŸ”₯

If there's no selection or the pointer is outside the selection, this action prepares to start a secondary selection at the pointer position.

Note: When dragging a secondary selection to a different widget, focus will shift momentarily to the second widget, and then back to the original widget. This will generate callbacks to the XmNlosingFocusCallback procedures as focus is lost (by each widget) as well as callbacks to the XmNfocusCallback procedures as focus is regained. Focus really said "brb" and then came right back πŸ’€ not the dramatic exit and re-entrance.

πŸ™ˆ process-cancel()

Cancels the current extend-adjust(), secondary-adjust() or process-bdrag() operation and leaves the selection state as it was before the operation; otherwise, and if the parent is a manager, passes the event to the parent. Undo energy, but for whatever you were mid-doing ✨

πŸ’œ process-down(extend)

  • If XmNeditMode is XmSINGLE_LINE_EDIT, and XmNnavigationType is XmNONE, it traverses to the widget below the current one in the tab group.
  • If XmNeditMode is XmMULTI_LINE_EDIT and 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.

In this case, the action will produce the XmNlosingFocusCallback callbacks with reason value XmCR_LOSING_FOCUS.

  • If XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor down one line.

The process-down() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

In <b>vertical writing</b>, it moves the insertion cursor <b>one character down</b>. Just one! Tiny little step, we love a controlled descent πŸ¦‹

🌸 process-home()

Moves the insertion cursor to the beginning of the line. Home sweet home 🏠

The process-home() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

πŸ“ process-return()

  • If XmNeditMode is XmSINGLE_LINE_EDIT, it calls the callbacks for XmNactivateCallback, and if the parent is a manager, passes the event to the parent.
  • If XmNeditMode is XmMULTI_LINE_EDIT, it inserts a newline.

The process-return() action during single-line edit produces calls to the XmNactivateCallback procedures with reason value XmCR_ACTIVATE. During multi-line editing, the process-return() action produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. Enter key is lowkey doing the absolute most and I respect it πŸ‘‘

πŸ’… process-shift-down()

  • If XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor down one line and selects.
  • If XmNeditMode is XmSINGLE_LINE_EDIT, this action behaves like process-up() in XmSINGLE_LINE_EDIT. Refer to the process-up() action.

The process-shift-down() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

In <b>vertical writing</b>, if it's called with the argument up, it moves the insertion cursor <b>one character up</b> and extends the current selection. If it's called with the argument down, it moves the insertion cursor <b>one character down</b> and extends the current selection. Yes the name says down and the argument can say up, don't think about it too hard bestie 😭

🧚 process-shift-up()

  • If XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor up one line and selects.
  • If XmNeditMode is XmSINGLE_LINE_EDIT, this action behaves like process-up() in XmSINGLE_LINE_EDIT. Refer to the process-up() action.

The process-shift-up() action produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR.

In <b>vertical writing</b>, if it's called with the argument up, it moves the insertion cursor <b>one character up</b> and extends the current selection. If it's called with the argument down, it moves the insertion cursor <b>one character down</b> and extends the current selection.

⭐ process-tab(Prev|Next)

  • If XmNeditMode is XmSINGLE_LINE_EDIT, it traverses to the next tab group if the direction argument is Next, or to the previous tab group if the direction is Prev.
  • If XmNeditMode is XmMULTI_LINE_EDIT, and the direction is Next, the action inserts a tab. The Prev direction has no effect with XmMULTI_LINE_EDIT.

In the <b>Text widget</b>, there is a preset tab stop at every eighth columns. Every eighth! Aligned and gorgeous 🌈

The process-tab() action under multi-line editing produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. Under single-line editing, the action produces no callbacks, unless it results in the widget losing focus, in which case the XmNlosingFocusCallback procedures are called with reason value XmCR_LOSING_FOCUS.

🌈 process-up(extend)

  • If XmNeditMode is XmSINGLE_LINE_EDIT and XmNnavigationType is XmNONE, it traverses to the widget above the current one in the tab group.
  • If XmNeditMode is XmMULTI_LINE_EDIT, it moves the insertion cursor up one line.

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

The process-up() action under multi-line editing produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. Under single-line editing, it produces no callbacks unless it makes the widget lose focus β€” in which case, the XmNlosingFocusCallback procedures get called with reason value XmCR_LOSING_FOCUS. 😭

In vertical writing, it moves the insertion cursor one character up. ✨

  • redraw-display() β€” Redraws the contents of the text window. It produces no callbacks. πŸŽ€
  • scroll-cursor-vertically(percentage) β€” Scrolls the line containing the insertion cursor vertically to an intermediate position in the visible window, based on an input percentage. A value of 0 means the top of the window; a value of 100 means the bottom of the window. If this action is called with no argument, the line containing the insertion cursor is scrolled vertically to a new position designated by the y position of the event passed to the routine. It produces no callbacks. πŸ’«
  • scroll-one-line-down() β€” Scrolls the text area down one line. No callbacks. ⬇️
  • scroll-one-line-up() β€” Scrolls the text area up one line. No callbacks. ⬆️
  • secondary-adjust() β€” Extends the secondary selection to the pointer position. No callbacks. πŸ–±οΈ
  • secondary-notify() β€” Copies the secondary selection to the insertion cursor of the destination widget. It produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, and the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED. πŸ’Œ
  • secondary-start() β€” Marks the beginning of a secondary selection. No callbacks. 🌸
  • select-adjust() β€” Moves the current selection. The amount of text selected depends on the number of mouse clicks, as specified by the XmNselectionArray resource. It may produce no callbacks, however, it may produce calls to the XmNgainPrimaryCallback procedures. See callback description for more information. πŸ‘‘
  • select-all() β€” Selects all text. It may produce calls to the XmNgainPrimaryCallback procedures. ✨
  • select-end() β€” Moves the current selection. The amount of text selected depends on the number of mouse clicks, as specified by the XmNselectionArray resource. It produces no callbacks. 🎯
  • select-start() β€” Marks the beginning of a new selection region. It may produce calls to the XmNgainPrimaryCallback procedures. 🫢
  • self-insert() β€” If XmNpendingDelete is True and the cursor is not disjoint from the current selection, deletes the entire selection. Inserts the character associated with the key pressed at the insertion cursor. It produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. πŸ’…
  • set-anchor() β€” Resets the anchor point for extended selections. Resets the destination of secondary selection actions. No callbacks. βš“
  • set-insertion-point() β€” Sets the insertion position to the position of the mouse pointer. It produces calls to the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. Note that if the mouse pointer is already over the position of the insertion cursor, the cursor will not be moved, and no callbacks will be produced. πŸ–±οΈ
  • set-selection-hint() β€” Sets the text source and location of the current selection. No callbacks. πŸ“
  • toggle-add-mode() β€” Toggles the state of Add Mode. No callbacks. πŸ”
  • toggle-overstrike() β€” Toggles the state of the text insertion mode. By default, characters typed into the Text widget are inserted at the position of the insertion cursor. In overstrike mode, characters entered into the Text widget replace the characters that directly follow the insertion cursor. In overstrike mode, when the end of a line is reached, characters are appended to the end of the line. ⌨️

The following traversal actions generate no callbacks unless they result in the loss of focus by the widget in question, as when XmNnavigationType is XmNONE. In this case, they produce calls to the XmNlosingFocusCallback procedures, with reason value XmCR_FOCUS_MOVED. πŸ’€

  • traverse-home() β€” Traverses to the first widget in the tab group. 🏠
  • traverse-next() β€” Traverses to the next widget in the tab group. ➑️
  • traverse-prev() β€” Traverses to the previous widget in the tab group. ⬅️
  • unkill() β€” Restores last killed text to the position of the insertion cursor (or whatever is currently in the CUT_BUFFER0). The inserted text appears before the insertion cursor. It produces calls to the XmNmodifyVerifyCallback procedures with reason value XmCR_MODIFYING_TEXT_VALUE, the XmNvalueChangedCallback procedures with reason value XmCR_VALUE_CHANGED, and the XmNmotionVerifyCallback procedures with reason value XmCR_MOVING_INSERT_CURSOR. 🧟

✨ Additional Behavior ✨

This widget has the following additional behavior: πŸ’–

  • <FocusIn> β€” Draws the insertion cursor as solid and starts blinking the cursor. πŸ‘€
  • <FocusOut> β€” Displays the insertion cursor as a stippled I-beam unless it is the destination widget and stops the cursor from blinking. 😴

πŸ¦‹ Virtual Bindings πŸ¦‹

The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3). 🧚


Okay bestie, that’s literally the whole page! Footer says source/version: XmText(library call) and the date that came with it β€” bye, ily! πŸ’–βœ¨