XMTEXT(3)
β¨ 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 typeCOMPOUND_TEXT.STRINGβ The widget transfers the selected text as typeSTRING.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 typeCOMPOUND_TEXT.UTF8_STRINGβ The widget transfers the selected text as typeUTF8_STRING.DELETEβ The widget deletes the selected text._MOTIF_CLIPBOARD_TARGETSβ The widget transfers, as typeATOM, 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 toSTRING, these includeSTRING; otherwise, they includeCOMPOUND_TEXT._MOTIF_DEFERRED_CLIPBOARD_TARGETSβ The widget transfers, as typeATOM, a list of the targets it supports for delayed transfer for theCLIPBOARDselection. This widget currently supplies no targets for_MOTIF_DEFERRED_CLIPBOARD_TARGETS._MOTIF_EXPORT_TARGETSβ The widget transfers, as typeATOM, a list of the targets to be used as the value of the DragContext'sXmNexportTargetsin a drag-and-drop transfer. These includeCOMPOUND_TEXT,UTF8_STRING, the encoding of the locale,STRING,TEXT,BACKGROUND, andFOREGROUND._MOTIF_LOSE_SELECTIONβ The widget takes the following actions:- When losing the
PRIMARYselection, it unhighlights the selected text and calls theXmNlosePrimaryCallbackprocedures. - When losing the
SECONDARYselection, it removes the secondary selection highlight. - When losing the
_MOTIF_DESTINATIONselection, if the widget does not have focus, it changes the cursor to indicate that the widget is no longer the destination.
- When losing the
As a source of data, Text also supports the following standard Motif targets:
BACKGROUNDβ The widget transfersXmNbackgroundas typePIXEL.CLASSβ The widget finds the first shell in the widget hierarchy that has aWM_CLASSproperty 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 typeWINDOW.COLORMAPβ The widget transfersXmNcolormapas typeCOLORMAP.FOREGROUNDβ The widget transfersXmNforegroundas typePIXEL.NAMEβ The widget finds the first shell in the widget hierarchy that has aWM_NAMEproperty and transfers the contents as text in the current locale.TARGETSβ The widget transfers, as typeATOM, a list of the targets it supports. These include the standard targets in this list. These also includeCOMPOUND_TEXT,UTF8_STRING, the encoding of the locale,STRING, andTEXT.TIMESTAMPβ The widget transfers the timestamp used to acquire the selection as typeINTEGER._MOTIF_RENDER_TABLEβ The widget transfersXmNrenderTableif it exists, or else the default text render table, as typeSTRING._MOTIF_ENCODING_REGISTRYβ The widget transfers its encoding registry as typeSTRING. The value is a list ofNULLseparated 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 callingXmRegisterSegmentEncodingandXmMapSegmentEncoding.
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:
- The encoding of the locale
TEXTUTF8_STRINGCOMPOUND_TEXTSTRING
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:
UTF8_STRINGCOMPOUND_TEXTSTRING
β¨ 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, andCSG1.
Here we go, one by one, no skipping, we do not leave the girlies behind β¨
XmNactivateCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. a callback slot, and it starts out completely empty.XmNautoShowCursorPositionβ classXmCAutoShowCursorPosition, typeBoolean, defaultTrue, accessCSG. yes/no situation, and the default is a big ol' yes.XmNcursorPositionβ classXmCCursorPosition, typeXmTextPosition, default0, accessCSG. starts at0, like every good index.XmNcursorPositionVisibleβ classXmCCursorPositionVisible, typeBoolean, defaultdynamic, accessCSG. note that the default here isdynamic, not a plain true/false, okay? okay.XmNdestinationCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. another empty callback slot at the start.XmNeditableβ classXmCEditable, typeBoolean, defaultTrue, accessCSG. can you edit it? default says yes πXmNeditModeβ classXmCEditMode, typeint, defaultXmSINGLE_LINE_EDIT, accessCSG. anint, and out of the box you're inXmSINGLE_LINE_EDIT.XmNfocusCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. callback slot, startsNULL, as the girlies do.XmNgainPrimaryCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. callback slot,NULLdefault, iconic.XmNlosePrimaryCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. yes bestie, also a callback slot, alsoNULL.XmNlosingFocusCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. and again: callback slot,NULLdefault π«ΆXmNmarginHeightβ classXmCMarginHeight, typeDimension, default5, accessCSG. aDimension, default5.XmNmarginWidthβ classXmCMarginWidth, typeDimension, default5, accessCSG. also aDimension, also5. symmetry, we love her.XmNmaxLengthβ classXmCMaxLength, typeint, defaultlargest integer, accessCSG. the default is literallylargest integer, so likeβ¦ go off, no cap πXmNmodifyVerifyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. callback slot,NULLat the start.XmNmodifyVerifyCallbackWcsβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. theWcssibling, same deal: callback slot,NULL.XmNmotionVerifyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. callback slot,NULL, we've been here before πXmtotalLinesβ classXmCTotalLines, typeint, defaultdynamic, accessC. heads up bestie, this one is writtenXmtotalLinesβ noNin there β and the default isdynamic. That's exactly how it appears, so don't go "fixing" it, fr fr.XmNsourceβ classXmCSource, typeXmTextSource, defaultDefault source, accessCSG. anXmTextSource, and it defaults to theDefault source.XmNtopCharacterβ classXmCTopCharacter, typeXmTextPosition, default0, accessCSG. starts at0.XmNvalueβ classXmCValue, typeString, default"", accessCSG. aString, defaulting to""β empty, blank, a clean slate β¨XmNvalueChangedCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessC. callback slot,NULLdefault, you know the drill.XmNvalueWcsβ classXmCvalueWcs, typewchar_t *, default(wchar_t *)"", accessCSG1. yep, the class really isXmCvalueWcswith a lowercasev, and the default is(wchar_t *)"". Also notice the access isCSG1, not plainCSGβ the1is doing something, see the note below πXmNverifyBellβ classXmCVerifyBell, typeBoolean, defaultdynamic, accessCSG. aBooleanwith adynamicdefault.
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 theactivate()action. The struct whose address gets passed along is anXmAnyCallbackStruct, and the reason it sends isXmCR_ACTIVATE. classic activation moment β¨XmNautoShowCursorPositionβ set it toTrueand 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 toFalsedoes 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 is0(zero). zero-indexed, as the universe intended πXmNcursorPositionVisibleβ if the widget has anXmPrintShellas one of its ancestors, the default isFalse. 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 anXmDestinationCallbackStruct, and the reason isXmCR_OK. receiving era π«ΆXmNeditableβTruemeans the user can edit the text string.Falsemeans the user is prohibited from editing it. locked down fr fr π- When
XmNeditableis used on a widget, it sets the dropsite toXmDROP_SITE_ACTIVE.
- When
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_EDITgives 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
XmNeditModeisXmSINGLE_LINE_EDITare undefined. Not "weird", not "buggy" β undefined. Don't do it. π
- > warning: the results of putting a Text widget inside a ScrolledWindow when the Text's
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 theXmNvalueresource or theXmTextSetStringfunction 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 generatesXmNmodifyVerifyCallback. only the originator, not the whole friend group π- If both
XmNmodifyVerifyCallbackandXmNmodifyVerifyCallbackWcsare registered callback lists, the procedure(s) in theXmNmodifyVerifyCallbacklist is always executed first; and the resulting data β which may have been modified β is passed to theXmNmodifyVerifyCallbackWcscallback routines. pipeline order matters, no cap π₯
- If both
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 theXmNmodifyVerifyCallbackWcs. same deal, wide-character edition π¦- If both
XmNmodifyVerifyCallbackandXmNmodifyVerifyCallbackWcsare registered callback lists, the procedure(s) in theXmNmodifyVerifyCallbacklist is always executed first; and the resulting data β which may have been modified β is passed to theXmNmodifyVerifyCallbackWcscallback routines.
- If both
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 oneXmNmotionVerifyCallbackto 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 is0(zero). zero again, iconic β- If
XmNeditModeisXmMULTI_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. XtGetValuesforXmNtopCharacterreturns 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 π
- If
XmNtotalLinesβ the number of lines in the text widget buffer (not necessarily visible). The initial value1means 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 achar*data value. Moves the cursor to position0unless a value ofXmNcursorPositionwas explicitly supplied in the argument list. IfXmNvalueandXmNvalueWcsare both defined, the value ofXmNvalueWcssupersedes that ofXmNvalue.XtGetValuesreturns a copy of the value of the internal buffer, andXtSetValuescopies 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 theXmNvalueChangedCallback. originator-only again, iykyk π- This callback represents a change in the source in the Text, not in the Text widget.
- The
XmNvalueChangedCallbackshould occur only in pairs with anXmNmodifyVerifyCallbackβ assuming thedoitflag in the callback structure of theXmNmodifyVerifyCallbackis not set toFalse. duo or it didn't happen π
XmNvalueWcsβ the string value of the Text widget as awchar_t*data value. Moves the cursor to position0unless a value ofXmNcursorPositionwas explicitly supplied in the argument list. wide-char version, same cursor rules β¨- > heads up: this resource cannot be specified in a resource file. π
- If
XmNvalueandXmNvalueWcsare both defined, the value ofXmNvalueWcssupersedes that ofXmNvalue.XtGetValuesreturns a copy of the value of the internal buffer encoded as a wide character string.XtSetValuescopies 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'sXmNaudibleWarningresource. π 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β classXmCPendingDelete, typeBoolean, defaultTrue, accessCSGXmNselectionArrayβ classXmCSelectionArray, typeXtPointer, defaultdefault array, accessCSGXmNselectionArrayCountβ classXmCSelectionArrayCount, typeint, default4, accessCSGXmNselectThresholdβ classXmCSelectThreshold, typeint, default5, accessCSGXmNpendingDeleteβ pending delete mode is on when this Boolean value isTrue. 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 ofXmTextScanTypeelements, andXmTextScanTypeis 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:XmSELECT_POSITION, which resets the insert cursor position. β¨XmSELECT_WORD, which selects a word. π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 (XmNwordWrapisTrue), it will ignore the newlines that the widget inserted automatically. This one is the default. π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 (XmNwordWrapisTrue), the newlines the widget inserted automatically will be treated as delimiting lines. πXmSELECT_ALL, which selects all of the text. literally all of it, slay. π₯
XmNselectionArrayCountβ tells you how many elements live in theXmNselectionArrayresource. 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 whenBtn2DownandBtn1Downare 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:CSGXmNcolumnsβ Class:XmCColumns, Type:short, Default:dynamic, Access:CSGXmNcursorPositionVisibleβ Class:XmCCursorPositionVisible, Type:Boolean, Default:True, Access:CSGXmNfontListβ Class:XmCFontList, Type:XmFontList, Default:dynamic, Access:CSGXmNrenderTableβ Class:XmCRenderTable, Type:XmRenderTable, Default:dynamic, Access:CSGXmNresizeHeightβ Class:XmCResizeHeight, Type:Boolean, Default:False, Access:CSGXmNresizeWidthβ Class:XmCResizeWidth, Type:Boolean, Default:False, Access:CSGXmNrowsβ Class:XmCRows, Type:short, Default:dynamic, Access:CSGXmNwordWrapβ 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 to0(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 than0(zero). The default value depends on the value of theXmNwidthresource β and if no width is specified, the default is20. β¨
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 isTrue, 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 isNULLat initialization, the widget's parent hierarchy gets searched for an ancestor holding theXmQTspecifyRenderTabletrait. If such an ancestor is found, the font list is initialized to theXmTEXT_RENDER_TABLEvalue 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 ofXmNrenderTableisNULLat initialization, the widget's parent hierarchy gets searched for an ancestor holding theXmQTspecifyRenderTabletrait. If such an ancestor is found, the font list is initialized to theXmTEXT_RENDER_TABLEvalue 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 isTrue, 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 toTrue, 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 whenXmNscrollVerticalisTrue.
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 isTrue, it means Text attempts to resize its width to accommodate all the text contained in the widget. This attribute is ignored ifXmNwordWrapisTrue. π¦
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 resourceXmNeditModeisXmSINGLE_LINE_EDIT. The value must be greater than0(zero). The default value depends on the value of theXmNheightresource β and if no height is specified, the default is1.
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 isTrue, 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 resourceXmNeditModeisXmSINGLE_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 theXmNscrollHorizontalresource isFalse. π
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β classXmCScroll, typeBoolean, defaultTrue, accessCGXmNscrollLeftSideβ classXmCScrollSide, typeBoolean, defaultFalse, accessCGXmNscrollTopSideβ classXmCScrollSide, typeBoolean, defaultFalse, accessCGXmNscrollVerticalβ classXmCScroll, typeBoolean, defaultTrue, accessCG
bestie listen π real quick note about that table: ifXmNlayoutDirectionisXmTOP_TO_BOTTOM, the default isTrue. yes, actually. that's the plot twist.
XmNscrollHorizontalβ when this Boolean isTrue, it adds aScrollBarso your user can scroll sideways through the text. it gets forced toFalsewhen the Text widget lives in aScrolledWindowwithXmNscrollingPolicyset toXmAUTOMATIC. also, whenXmNlayoutDirectionisXmTOP_TO_BOTTOM, this attribute is ignored if theXmTextwidget resourceXmNeditModeisXmSINGLE_LINE_EDIT.XmNscrollLeftSideβ when this Boolean isTrue, it means the verticalScrollBarshould sit on the left side of the scrolled text window. this attribute gets ignored ifXmNscrollVerticalisFalse, or if the Text resourceXmNeditModeisXmSINGLE_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 isTrue, the horizontalScrollBargets 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 isTrue, it adds aScrollBarso your user can scroll up and down through the text. this attribute is ignored if the Text resourceXmNeditModeisXmSINGLE_LINE_EDIT. it gets forced toFalsewhen the Text widget is placed in aScrolledWindowwithXmNscrollingPolicyset toXmAUTOMATIC.
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β classXmCBottomShadowColor, typePixel, defaultdynamic, accessCSGXmNbottomShadowPixmapβ classXmCBottomShadowPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNconvertCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNforegroundβ classXmCForeground, typePixel, defaultdynamic, accessCSGXmNhelpCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNhighlightColorβ classXmCHighlightColor, typePixel, defaultdynamic, accessCSGXmNhighlightOnEnterβ classXmCHighlightOnEnter, typeBoolean, defaultFalse, accessCSGXmNhighlightPixmapβ classXmCHighlightPixmap, typePixmap, defaultdynamic, accessCSGXmNhighlightThicknessβ classXmCHighlightThickness, typeDimension, default2, accessCSGXmNlayoutDirectionβ classXmCLayoutDirection, typeXmDirection, defaultdynamic, accessCGXmNnavigationTypeβ classXmCNavigationType, typeXmNavigationType, defaultXmTAB_GROUP, accessCSGXmNpopupHandlerCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNshadowThicknessβ classXmCShadowThickness, typeDimension, default2, accessCSGXmNtopShadowColorβ classXmCTopShadowColor, typePixel, defaultdynamic, accessCSGXmNtopShadowPixmapβ classXmCTopShadowPixmap, typePixmap, defaultdynamic, accessCSGXmNtraversalOnβ classXmCTraversalOn, typeBoolean, defaultTrue, accessCSGXmNunitTypeβ classXmCUnitType, typeunsigned char, defaultdynamic, accessCSGXmNuserDataβ classXmCUserData, typeXtPointer, defaultNULL, accessCSG
π Core Resource Set π
XmNacceleratorsβ classXmCAccelerators, typeXtAccelerators, defaultdynamic, accessCSGXmNancestorSensitiveβ classXmCSensitive, typeBoolean, defaultdynamic, accessGXmNbackgroundβ classXmCBackground, typePixel, defaultdynamic, accessCSGXmNbackgroundPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderColorβ classXmCBorderColor, typePixel, defaultXtDefaultForeground, accessCSGXmNborderPixmapβ classXmCPixmap, typePixmap, defaultXmUNSPECIFIED_PIXMAP, accessCSGXmNborderWidthβ classXmCBorderWidth, typeDimension, default0, accessCSGXmNcolormapβ classXmCColormap, typeColormap, defaultdynamic, accessCGXmNdepthβ classXmCDepth, typeint, defaultdynamic, accessCGXmNdestroyCallbackβ classXmCCallback, typeXtCallbackList, defaultNULL, accessCXmNheightβ classXmCHeight, typeDimension, defaultdynamic, accessCSGXmNinitialResourcesPersistentβ classXmCInitialResourcesPersistent, typeBoolean, defaultTrue, accessCXmNmappedWhenManagedβ classXmCMappedWhenManaged, typeBoolean, defaultTrue, accessCSGXmNscreenβ classXmCScreen, typeScreen *, defaultdynamic, accessCGXmNsensitiveβ classXmCSensitive, typeBoolean, defaultTrue, accessCSGXmNtranslationsβ classXmCTranslations, typeXtTranslations, defaultdynamic, accessCSGXmNwidthβ classXmCWidth, typeDimension, defaultdynamic, accessCSGXmNxβ classXmCPosition, typePosition, default0, accessCSGXmNyβ classXmCPosition, typePosition, default0, accessCSG
π 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 theXEventthat 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 theXEventthat triggered the callback. it can beNULL. 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. SetdoittoFalseand boom, the action is negated. But bestie, not every action can be cancelled like that. For example,XmCR_LOSING_FOCUScallbacks? 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 ascurrInsert.endPosβ the ending position of the text to modify. If no text is replaced or deleted, it's the same asstartPos. And if this callback isn't a modify verification callback, it's the same ascurrInsert. Matching energy.textβ points to a structure of typeXmTextBlockRec. 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, eitherXmFMT_8_BITorXmFMT_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 theXEventthat triggered the callback. It can beNULL. 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. SettingdoittoFalsenegates the action. But again, not all actions may be negated. For example,XmCR_LOSING_FOCUScallbacks 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 ascurrInsert.endPosβ the ending position of the text to modify. If no text is replaced or deleted, the value is the same asstartPos. If the callback is not a modify verification callback, this value is the same ascurrInsert.textβ points to the following structure of typeXmTextBlockRecWcs. 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,endPosXmCR_MODIFYING_TEXT_VALUEβ valid fields:reason,event,doit,currInsert,newInsert,startPos,endPos,textXmCR_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 theXEventthat triggered the callback. It can beNULL.selectionβ indicates the selection for which data transfer is being requested. Possible values areCLIPBOARD,PRIMARY,SECONDARY, and_MOTIF_DROP.operationβ indicates the type of transfer operation requested.- When the selection is
PRIMARYorSECONDARY, possible values areXmMOVE,XmCOPY, andXmLINK. - When the selection is
CLIPBOARD, possible values areXmCOPYandXmLINK. - When the selection is
_MOTIF_DROP, possible values areXmMOVE,XmCOPY,XmLINK, andXmOTHER. A value ofXmOTHERmeans that the callback procedure must get further information from theXmDropProcCallbackStructstructure in thedestination_datamember.
- When the selection is
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'sXmNdropProc, anddestination_datais a pointer to theXmDropProcCallbackStructstructure passed to theXmNdropProcprocedure. When the selection isSECONDARY,destination_datais anAtomrepresenting a target recommmended by the selection owner for use in converting the selection. Otherwise,destination_dataisNULL.location_dataβ contains information about the location where data is to be transferred. The value is alwaysNULLwhen the selection isCLIPBOARD. If the value isNULL, the data is to be inserted at the widget's cursor position. Otherwise, the value is a pointer to anXPointstructure containing the x- and y-coordinates at the location where the data is to be transferred. OnceXmTransferDoneprocedures start to be called,location_datawill 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 forXmNactivateCallback. 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)β IfXmNeditModeisXmMULTI_LINE_EDITand 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. Thebeep()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 theXmNconvertCallbackprocedures, possibly multiple times, for theCLIPBOARDselection. π¦copy-primary()β Copies the primary selection to just before the insertion cursor. This action calls theXmNdestinationCallbackprocedures for thePRIMARYselection and theXmCOPYoperation. It also calls the selection owner'sXmNconvertCallbackprocedures, possibly multiple times, for thePRIMARYselection.
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
XmNdestinationCallbackprocedures for the SECONDARY</> selection and theXmCOPYoperation. - the destination's
XmNdestinationCallbackprocedures or the destination component itself invokes the selection owner'sXmNconvertCallbackprocedures, 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
XmNdestinationCallbackprocedures for the PRIMARY</> selection and theXmCOPYoperation. - it calls the selection owner's
XmNconvertCallbackprocedures, 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
XmNconvertCallbackprocedures, possibly multiple times, for theCLIPBOARDselection. - if the transfer is successful, it then calls the
XmNconvertCallbackprocedures for theCLIPBOARDselection and theDELETEtarget. π₯
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
XmNdestinationCallbackprocedures for the PRIMARY</> selection and theXmMOVEoperation. - it calls the selection owner's
XmNconvertCallbackprocedures, possibly multiple times, for the PRIMARY</> selection. - if the transfer is successful, it then calls the selection owner's
XmNconvertCallbackprocedures for the PRIMARY</> selection and theDELETEtarget. cut-primary()may produce calls to theXmNgainPrimaryCallbackprocedures. 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 theXmNgainPrimaryCallbackprocedures. 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)β ifXmNeditModeisXmMULTI_LINE_EDITand 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 theXmNselectionArraysays 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 forXmNhelpCallbackif 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)β ifXmNpendingDeleteisTrueand the cursor is not disjoint from the current selection, it deletes the entire selection. Then it insertsstringbefore 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 ofright, it moves the insertion cursor one character to the right and extends the current selection. Called withleft, 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, andXmNpendingDeleteis set toTrue, 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, andXmNpendingDeleteis set toTrue, 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.
link-primary() π
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.
link-to() π¦
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
XmNeditModeisXmMULTI_LINE_EDITand you call this one with no argument, it moves the insertion cursor forward one page. Just vibing forward, page by page bestie π - If
XmNeditModeisXmMULTI_LINE_EDITand you call it with an argument ofextend, 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
XmNeditModeisXmMULTI_LINE_EDITand this action is called with no argument, it moves the insertion cursor back one page. - If
XmNeditModeisXmMULTI_LINE_EDITand this action is called with an argument ofextend, 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
XmNeditModeisXmMULTI_LINE_EDITand this action is called with no argument, it moves the insertion cursor forward one page. - If
XmNeditModeisXmMULTI_LINE_EDITand this action is called with an argument ofextend, 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
XmNeditModeisXmMULTI_LINE_EDITand this action is called with no argument, it moves the insertion cursor back one page. - If
XmNeditModeisXmMULTI_LINE_EDITand this action is called with an argument ofextend, 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 theXmNlosingFocusCallbackprocedures as focus is lost (by each widget) as well as callbacks to theXmNfocusCallbackprocedures 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
XmNeditModeisXmSINGLE_LINE_EDIT, andXmNnavigationTypeisXmNONE, it traverses to the widget below the current one in the tab group. - If
XmNeditModeisXmMULTI_LINE_EDITand this action is called with an argument ofextend, 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
XmNeditModeisXmMULTI_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
XmNeditModeisXmSINGLE_LINE_EDIT, it calls the callbacks forXmNactivateCallback, and if the parent is a manager, passes the event to the parent. - If
XmNeditModeisXmMULTI_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
XmNeditModeisXmMULTI_LINE_EDIT, it moves the insertion cursor down one line and selects. - If
XmNeditModeisXmSINGLE_LINE_EDIT, this action behaves likeprocess-up()inXmSINGLE_LINE_EDIT. Refer to theprocess-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
XmNeditModeisXmMULTI_LINE_EDIT, it moves the insertion cursor up one line and selects. - If
XmNeditModeisXmSINGLE_LINE_EDIT, this action behaves likeprocess-up()inXmSINGLE_LINE_EDIT. Refer to theprocess-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
XmNeditModeisXmSINGLE_LINE_EDIT, it traverses to the next tab group if the direction argument isNext, or to the previous tab group if the direction isPrev. - If
XmNeditModeisXmMULTI_LINE_EDIT, and the direction isNext, the action inserts a tab. ThePrevdirection has no effect withXmMULTI_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
XmNeditModeisXmSINGLE_LINE_EDITandXmNnavigationTypeisXmNONE, it traverses to the widget above the current one in the tab group. - If
XmNeditModeisXmMULTI_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 of0means the top of the window; a value of100means 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 theXmNmodifyVerifyCallbackprocedures with reason valueXmCR_MODIFYING_TEXT_VALUE, and theXmNvalueChangedCallbackprocedures with reason valueXmCR_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 theXmNselectionArrayresource. It may produce no callbacks, however, it may produce calls to theXmNgainPrimaryCallbackprocedures. See callback description for more information. πselect-all()β Selects all text. It may produce calls to theXmNgainPrimaryCallbackprocedures. β¨select-end()β Moves the current selection. The amount of text selected depends on the number of mouse clicks, as specified by theXmNselectionArrayresource. It produces no callbacks. π―select-start()β Marks the beginning of a new selection region. It may produce calls to theXmNgainPrimaryCallbackprocedures. π«Άself-insert()β IfXmNpendingDeleteisTrueand 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 theXmNmodifyVerifyCallbackprocedures with reason valueXmCR_MODIFYING_TEXT_VALUE, theXmNvalueChangedCallbackprocedures with reason valueXmCR_VALUE_CHANGED, and theXmNmotionVerifyCallbackprocedures with reason valueXmCR_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 theXmNmotionVerifyCallbackprocedures with reason valueXmCR_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 theCUT_BUFFER0). The inserted text appears before the insertion cursor. It produces calls to theXmNmodifyVerifyCallbackprocedures with reason valueXmCR_MODIFYING_TEXT_VALUE, theXmNvalueChangedCallbackprocedures with reason valueXmCR_VALUE_CHANGED, and theXmNmotionVerifyCallbackprocedures with reason valueXmCR_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). π§
π RELATED π
Core(3)XmCreateScrolledText(3)XmCreateText(3)XmFontList(3)XmFontListAppendEntry(3)XmPrimitive(3)XmTextClearSelection(3)XmTextCopy(3)XmTextCopyLink(3)XmTextCut(3)XmTextEnableRedisplay(3)XmTextDisableRedisplay(3)XmTextField(3)XmTextFindString(3)XmTextFindStringWcs(3)XmTextGetBaseline(3)XmTextGetEditable(3)XmTextGetInsertionPosition(3)XmTextGetLastPosition(3)XmTextGetMaxLength(3)XmTextGetSelection(3)XmTextGetSelectionWcs(3)XmTextGetSelectionPosition(3)XmTextGetSource(3)XmTextGetString(3)XmTextGetStringWcs(3)XmTextGetSubstring(3)XmTextGetSubstringWcs(3)XmTextGetTopCharacter(3)XmTextInsert(3)XmTextInsertWcs(3)XmTextPaste(3)XmTextPasteLink(3)XmTextPosToXY(3)XmTextPosition(3)XmTextRemove(3)XmTextReplace(3)XmTextReplaceWcs(3)XmTextScroll(3)XmTextSetAddMode(3)XmTextSetEditable(3)XmTextSetHighlight(3)XmTextSetInsertionPosition(3)XmTextSetMaxLength(3)XmTextSetSelection(3)XmTextSetSource(3)XmTextSetString(3)XmTextSetStringWcs(3)XmTextSetTopCharacter(3)XmTextShowPosition(3)XmTextXYToPos(3)XmVaCreateText(3)XmVaCreateManagedText(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! πβ¨
π¦ where this page comes from
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms