XmText(3X) UNIX System V XmText(3X)
NAME
XmText - the Text widget class.
SYNOPSIS
#include <Xm/Text.h>
DESCRIPTION
Text provides a single-line and multiline text editor for customizing
both user and programmatic interfaces. It can be used for single-line
string entry, forms entry with verification procedures, and full-window
editing. It provides an application with a consistent editing system for
textual data. The screen's textual data adjusts to the application
writer's needs.
Text provides separate callback lists to verify movement of the insert
cursor, modification of the text, and changes in input focus. Each of
these callbacks provides the verification function with the widget
instance, the event that caused the callback, and a data structure
specific to the verification type. From this information the function
can verify if the application considers this to be a legitimate state
change and can signal the widget whether to continue with the action.
The user interface tailors a new set of translations. The default
translations provide key bindings for insert cursor movement, deletion,
insertion, and selection of text.
Text allows the user to select regions of text. Selection is based on
the model specified in the Inter-Client Communication Conventions Manual
(ICCCM). Text supports primary and secondary selection.
Mouse Selection
The Text widget allows text to be edited, inserted, and selected. The
user can cut, copy, and paste text using the clipboard, primary transfer,
or secondary transfer.
The insertion cursor, displayed as an I-beam, shows where input is
inserted. Clicking BSelect moves the insertion cursor and deselects the
current selection if it is in the Text widget. Clicking BToggle moves
the insertion cursor but does not change the current selection.
The Text widget allows the user to select a range of text. Pressing
BSelect starts a new primary selection. Dragging BSelect selects all
text between the position of the pointer and the position where BSelect
was pressed.
BExtend extends a selection using the balance-beam method. When the user
presses BExtend, the selection becomes anchored at the edge of the
selection farthest from the pointer position. When the user releases
BExtend, the selection extends from the anchor to the position where
10/89 Page 1
XmText(3X) UNIX System V XmText(3X)
BExtend is released, and any text outside that range is deselected.
Clicking BDrag copies the current selection to the insertion cursor,
whether the current selection is in the same widget or a different
widget. Clicking MAlt BDrag cuts the current selection to the insertion
cursor.
The destination cursor shows the last place that text was inserted,
edited, or selected. When it is separate from the insertion cursor, it
is shown as a caret. When the user pastes data from the clipboard, the
data go to the destination cursor. Clicking BSelect moves the
destination cursor. Clicking BToggle also moves the destination cursor,
but only if no text is selected in the widget.
Pressing BDrag starts a new secondary selection. Dragging BDrag makes a
secondary selection consisting of all text between the position of the
pointer and the position where BDrag was pressed. Releasing BDrag copies
the secondary selection to the destination cursor, whether the
destination cursor is in the same widget or a different widget. Dragging
MAlt BDrag also makes a secondary selection, and releasing MAlt BDrag
cuts the secondary selection to the destination cursor.
Keyboard Selection
All selection operations available from the mouse are also available from
the keyboard. Text has two keyboard selection modes, Normal Mode and Add
Mode. In Normal Mode, if text is selected, a navigation operation
deselects the selected text and moves the destination cursor to the
insertion cursor before navigating. In Add Mode, navigation operations
have no effect other than navigation. In both modes, pressing KSelect
has the same effect as pressing BSelect at that position.
Pressing KExtend extends the current selection to the insertion cursor
using the balance-beam method. The current selection becomes anchored at
the edge of the selection farthest from the insertion cursor. The
selection then extends from the anchor to the insertion cursor, and any
text outside that range is deselected. If no text is selected, KExtend
selects the text between the destination cursor and the insertion cursor.
Shifted navigation operations also extend a selection. In Normal Mode,
if no text is selected or if the selection is disjoint from the insertion
cursor, a shifted navigation operation selects the navigated text and
deselects any text outside that range. In Add Mode, if no text is
selected, a shifted navigation operation first navigates and then selects
the text between the destination cursor and the insertion cursor.
In the remaining cases - Normal Mode with the insertion cursor at or
inside a selection, and Add Mode with any selection - a shifted
navigation operation extends the selection using the balance-beam method.
Before navigation, the current selection becomes anchored at the edge of
the selection farthest from the insertion cursor. After navigation, the
selection extends from the anchor to the insertion cursor, and any text
Page 2 10/89
XmText(3X) UNIX System V XmText(3X)
outside that range is deselected.
KPrimaryCopy copies the current selection to the insertion cursor.
KPrimaryCut cuts the current selection to the insertion cursor.
KQuickCopy and KQuickCut start a secondary selection at the insertion
cursor. Navigation operations extend the secondary selection.
KQuickExtend then copies or cuts the secondary selection to the
destination cursor.
Classes
Text inherits behavior and resources from Core and Primitive classes.
The class pointer is xmTextWidgetClass.
The class name is XmText.
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).
10/89 Page 3
XmText(3X) UNIX System V XmText(3X)
______________________________________________________________________________________________________
| XmText Resource Set |
|_________________________|___________________________|________________|____________________|________|
|Name | Class | Type | Default | Access|
|_________________________|___________________________|________________|____________________|________|
|_________________________|___________________________|________________|____________________|________|
|XmNactivateCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNautoShowCursorPosition| XmCAutoShowCursorPosition| Boolean | True | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNcursorPosition | XmCCursorPosition | XmTextPosition| 0 | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNeditable | XmCEditable | Boolean | True | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNeditMode | XmCEditMode | int | XmSINGLE_LINE_EDIT| CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNfocusCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNgainPrimaryCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNlosePrimaryCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNlosingFocusCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNmarginHeight | XmCMarginHeight | Dimension | 5 | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNmarginWidth | XmCMarginWidth | Dimension | 5 | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNmaxLength | XmCMaxLength | int | largest integer | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNmodifyVerifyCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNmotionVerifyCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNsource | XmCSource | XmTextSource | Default source | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNtopCharacter | XmCTextPosition | XmTextPosition| 0 | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNvalue | XmCValue | String | "" | CSG |
|_________________________|___________________________|________________|____________________|________|
|XmNvalueChangedCallback | XmCCallback | XtCallbackList| NULL | C |
|_________________________|___________________________|________________|____________________|________|
|XmNverifyBell | XmCVerifyBell | Boolean | True | CSG |
|_________________________|___________________________|________________|____________________|________|
XmNactivateCallback
Specifies the list of callbacks that is called when the user
invokes an event that calls the Activate() function. The type of
the structure whose address is passed to this callback is
XmAnyCallbackStruct. The reason sent by the callback is
XmCR_ACTIVATE.
Page 4 10/89
XmText(3X) UNIX System V XmText(3X)
XmNautoShowCursorPosition
Ensures that the visible text contains the insert cursor when set
to True. If the insert cursor changes, the contents of Text may
scroll in order to bring the insertion point into the window.
XmNcursorPosition
Indicates the position in the text where the current insert cursor
is to be located. Position is determined by the number of
characters from the beginning of the text. The first character
position is 0.
XmNeditable
Indicates that the user can edit the text string when set to True.
Prohibits the user from editing the text when set to False.
XmNeditMode
Specifies the set of keyboard bindings used in Text. The default
keyboard bindings (XmSINGLE_LINE_EDIT) provides the set of key
bindings to be used in editing single-line text. The multiline
bindings (XmMULTI_LINE_EDIT) provides the set of key bindings to be
used in editing multiline text.
The results of placing a Text widget inside a ScrolledWindow when
the Text's XmNeditMode is XmSINGLE_LINE_EDIT are undefined.
XmNfocusCallback
Specifies the list of callbacks called before Text has accepted
input focus. The type of the structure whose address is passed to
this callback is XmAnyCallbackStruct. The reason sent by the
callback is XmCR_FOCUS.
XmNgainPrimaryCallback
Specifies the list of callbacks called when an event causes the
Text widget to gain ownership of the primary selection. The reason
sent by the callback is XmCR_GAIN_PRIMARY.
XmNlosePrimaryCallback
Specifies the list of callbacks called when an event causes the
Text widget to lose ownership of the primary selection. The reason
sent by the callback is XmCR_LOSE_PRIMARY.
XmNlosingFocusCallback
Specifies the list of callbacks called before Text loses input
focus. The type of the structure whose address is passed to this
callback is XmTextVerifyCallbackStruct. The reason sent by the
callback is XmCR_LOSING_FOCUS.
XmNmarginHeight
Specifies the distance between the top edge of the widget window
and the text, and between the bottom edge of the widget window and
the text.
10/89 Page 5
XmText(3X) UNIX System V XmText(3X)
XmNmarginWidth
Specifies 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.
XmNmaxLength
Specifies the maximum length of the text string that can be entered
into text from the keyboard. Strings that are entered using the
XmNvalue resource or the XmTextSetString function ignore this
resource.
XmNmodifyVerifyCallback
Specifies the list of callbacks called before text is deleted from
or inserted into Text. The type of the structure whose address is
passed to this callback is XmTextVerifyCallbackStruct. The reason
sent by the callback is XmCR_MODIFYING_TEXT_VALUE.
XmNmotionVerifyCallback
Specifies the list of callbacks called before the insert cursor is
moved to a new position. The type of the structure whose address is
passed to this callback is XmTextVerifyCallbackStruct. The reason
sent by the callback is XmCR_MOVING_INSERT_CURSOR.
XmNsource
Specifies the source with which the widget displays text. If no
source is specified, the widget creates a default string source.
This resource can be used to share text sources between Text
widgets.
XmNtopCharacter
Displays the position of text at the top of the window. Position
is determined by the number of characters from the beginning of the
text. The first character position is 0.
If the XmNeditMode is XmMULTI_LINE_EDIT, the line of text that
contains the top character is displayed at the top of the widget
without shifting the text left or right. XtGetValues for
XmNtopCharacter returns the position of the first character in the
line that is displayed at the top of the widget.
XmNvalue
Displays the string value. XtGetValues returns the value of the
internal buffer and XtSetValues copies the string values into the
internal buffer.
XmNvalueChangedCallback
Specifies the list of callbacks called after text is deleted from
or inserted into Text. The type of the structure whose address is
passed to this callback is XmAnyCallbackStruct. The reason sent by
the callback is XmCR_VALUE_CHANGED.
Page 6 10/89
XmText(3X) UNIX System V XmText(3X)
XmNverifyBell
Specifies whether the bell should sound when the verification
returns without continuing the action. The default is True,
indicating that the bell should sound.
____________________________________________________________________________________
| XmText Input Resource Set |
|_______________________|________________________|_________|_______________|________|
| Name | Class | Type | Default | Access|
|_______________________|________________________|_________|_______________|________|
|_______________________|________________________|_________|_______________|________|
| XmNpendingDelete | XmCPendingDelete | Boolean| True | CSG |
|_______________________|________________________|_________|_______________|________|
| XmNselectionArray | XmCSelectionArray | Pointer| default array| CSG |
|_______________________|________________________|_________|_______________|________|
| XmNselectionArrayCount| XmCSelectionArrayCount| int | 4 | CSG |
|_______________________|________________________|_________|_______________|________|
| XmNselectThreshold | XmCSelectThreshold | int | 5 | CSG |
|_______________________|________________________|_________|_______________|________|
XmNpendingDelete
Indicates that pending delete mode is on when the Boolean value is
True. Pending deletion is defined as deletion of the selected text
when an insertion is made.
XmNselectionArray
Defines the actions for multiple mouse clicks. The value of the
resource is an array of XmTextScanType elements. XmTextScanType is
an enumeration indicating possible actions. Each mouse click
performed within half a second of the previous mouse click
increments the index into this array and performs the defined
action for that index. The possible actions in the order they
occur in the default array are:
⊕ XmSELECT_POSITION - resets the insert cursor position
⊕ XmSELECT_WORD - selects a word
⊕ XmSELECT_LINE - selects a line of text
⊕ XmSELECT_ALL - selects all of the text
XmNselectionArrayCount
Indicates the number of elements in the XmNselectionArray resource.
The value must not be negative.
XmNselectThreshold
Specifies the number of pixels of motion that is required to select
the next character when selection is performed using the click-drag
mode of selection. The value must not be negative.
10/89 Page 7
XmText(3X) UNIX System V XmText(3X)
_____________________________________________________________________________________
| XmText Output Resource Set |
|_________________________|__________________________|____________|_________|________|
| Name | Class | Type | Default| Access|
|_________________________|__________________________|____________|_________|________|
|_________________________|__________________________|____________|_________|________|
| XmNblinkRate | XmCBlinkRate | int | 500 | CSG |
|_________________________|__________________________|____________|_________|________|
| XmNcolumns | XmCColumns | short | dynamic| CSG |
|_________________________|__________________________|____________|_________|________|
| XmNcursorPositionVisible| XmCCursorPositionVisible| Boolean | True | CSG |
|_________________________|__________________________|____________|_________|________|
| XmNfontList | XmCFontList | XmFontList| dynamic| CSG |
|_________________________|__________________________|____________|_________|________|
| XmNresizeHeight | XmCResizeHeight | Boolean | False | CSG |
|_________________________|__________________________|____________|_________|________|
| XmNresizeWidth | XmCResizeWidth | Boolean | False | CSG |
|_________________________|__________________________|____________|_________|________|
| XmNrows | XmCRows | short | dynamic| CSG |
|_________________________|__________________________|____________|_________|________|
| XmNwordWrap | XmCWordWrap | Boolean | False | CSG |
|_________________________|__________________________|____________|_________|________|
XmNblinkRate
Specifies the blink rate of the text cursor in milliseconds. The
time indicated in the blink rate relates to the time the cursor is
visible and the time the cursor is invisible (that is, the time it
takes to blink the insertion cursor on and off is twice the blink
rate). The cursor does not blink when the blink rate is set to
zero. The value must not be negative.
XmNcolumns
Specifies the initial width of the text window measured in
character spaces. The value must be greater than 0. The default
value depends on the value of the XmNwidth resource. If no width
is specified the default is 20.
XmNcursorPositionVisible
Indicates that the insert cursor position is marked by a blinking
text cursor when the Boolean value is True.
XmNfontList
Specifies the font list to be used for Text. If this value is NULL
at initialization, it is initialized by looking up the parent
hierarchy of the widget for an ancestor that is a subclass of the
XmBulletinBoard, VendorShell, or XmMenuShell widget class. If such
an ancestor is found, the font list is initialized to the
appropriate default font list of the ancestor widget
(XmNdefaultFontList for VendorShell and XmMenuShell,
XmNtextFontList for XmBulletinBoard). See XmFontListCreate(3X) to
create a font list.
Page 8 10/89
XmText(3X) UNIX System V XmText(3X)
XmNresizeHeight
Indicates that Text attempts to resize its height to accommodate
all the text contained in the widget when the Boolean value is
True. If the Boolean value is set to True, the text is always
displayed starting from the first position in the source, even if
instructed otherwise. This attribute is ignored when the
application uses a ScrolledText widget and when XmNscrollVertical
is True.
XmNresizeWidth
Indicates that Text attempts to resize its width to accommodate all
the text contained in the widget when the Boolean value is True.
This attribute is ignored if XmNwordWrap is True.
XmNrows
Specifies the initial height of the text window measured in
character heights. This attribute is ignored if the text widget
resource XmNeditMode is XmSINGLE_LINE_EDIT. The value must be
greater than 0. The default value depends on the value of the
XmNheight resource. If no height is specified the default is 1.
XmNwordWrap
Indicates that lines are to be broken at word breaks (that is, the
text does not go off the right edge of the window) when the Boolean
value is True. Words are defined as a sequence of characters
separated by white space. White space is defined as a space, tab,
or newline. This attribute is ignored if the text widget resource
XmNeditMode is XmSINGLE_LINE_EDIT.
The following resources are used only when text is created in a
ScrolledWindow. See the man page for XmCreateScrolledText.
__________________________________________________________________
| XmText ScrolledText Resource Set |
|____________________|_______________|_________|_________|________|
| Name | Class | Type | Default| Access|
|____________________|_______________|_________|_________|________|
|____________________|_______________|_________|_________|________|
| XmNscrollHorizontal| XmCScroll | Boolean| True | CG |
|____________________|_______________|_________|_________|________|
| XmNscrollLeftSide | XmCScrollSide| Boolean| dynamic| CG |
|____________________|_______________|_________|_________|________|
| XmNscrollTopSide | XmCScrollSide| Boolean| False | CG |
|____________________|_______________|_________|_________|________|
| XmNscrollVertical | XmCScroll | Boolean| True | CG |
|____________________|_______________|_________|_________|________|
10/89 Page 9
XmText(3X) UNIX System V XmText(3X)
XmNscrollHorizontal
Adds a ScrollBar that allows the user to scroll horizontally
through text when the Boolean value is True. This attribute is
ignored if the Text resource XmNeditMode is XmSINGLELINEEDIT.
This resource is forced to False when the Text widget is placed in
a ScrolledWindow with XmNscrollingPolicy set to XmAUTOMATIC.
XmNscrollLeftSide
Indicates that the vertical ScrollBar should be placed on the left
side of the scrolled text window when the Boolean value is True.
This attribute is ignored if XmNscrollVertical is False or the Text
resource XmNeditMode is XmSINGLE_LINE_EDIT. The default value may
depend on the value of the XmNstringDirection resource.
XmNscrollTopSide
Indicates that the horizontal ScrollBar should be placed on the top
side of the scrolled text window when the Boolean value is True.
XmNscrollVertical
Adds a ScrollBar that allows the user to scroll vertically through
text when the Boolean value is True. This resource is forced to
False when the Text widget is placed in a ScrolledWindow with
XmNscrollingPolicy set to XmAUTOMATIC.
Inherited Resources
Text inherits behavior and resources from the following superclasses.
For a complete description of each resource, refer to the man page for
that superclass.
__________________________________________________________________________________________________
XmPrimitive Resource Set
__________________________________________________________________________________________________
Name Class Type Default Access
__________________________________________________________________________________________________
__________________________________________________________________________________________________
XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic CSG
__________________________________________________________________________________________________
XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
__________________________________________________________________________________________________
XmNforeground XmCForeground Pixel dynamic CSG
__________________________________________________________________________________________________
XmNhelpCallback XmCCallback XtCallbackList NULL C
__________________________________________________________________________________________________
XmNhighlightColor XmCHighlightColor Pixel dynamic CSG
__________________________________________________________________________________________________
XmNhighlightOnEnter XmCHighlightOnEnter Boolean False CSG
__________________________________________________________________________________________________
XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG
__________________________________________________________________________________________________
XmNhighlightThickness XmCHighlightThickness Dimension 2 CSG
__________________________________________________________________________________________________
Page 10 10/89
XmText(3X) UNIX System V XmText(3X)
|XmNnavigationType | XmCNavigationType | XmNavigationType| dynamic | CSG |
|_____________________|_______________________|__________________|______________________|________|
|XmNshadowThickness | XmCShadowThickness | Dimension | 2 | CSG |
|_____________________|_______________________|__________________|______________________|________|
|XmNtopShadowColor | XmCTopShadowColor | Pixel | dynamic | CSG |
|_____________________|_______________________|__________________|______________________|________|
|XmNtopShadowPixmap | XmCTopShadowPixmap | Pixmap | dynamic | CSG |
|_____________________|_______________________|__________________|______________________|________|
|XmNtraversalOn | XmCTraversalOn | Boolean | True | CSG |
|_____________________|_______________________|__________________|______________________|________|
|XmNunitType | XmCUnitType | unsigned char | dynamic | CSG |
|_____________________|_______________________|__________________|______________________|________|
|XmNuserData | XmCUserData | Pointer | NULL | CSG |
|_____________________|_______________________|__________________|______________________|________|
________________________________________________________________________________________________________________
Core Resource Set
________________________________________________________________________________________________________________
Name Class Type Default Access
________________________________________________________________________________________________________________
________________________________________________________________________________________________________________
XmNaccelerators XmCAccelerators XtAccelerators dynamic CSG
________________________________________________________________________________________________________________
XmNancestorSensitive XmCSensitive Boolean dynamic G
________________________________________________________________________________________________________________
XmNbackground XmCBackground Pixel dynamic CSG
________________________________________________________________________________________________________________
XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
________________________________________________________________________________________________________________
XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG
________________________________________________________________________________________________________________
XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
________________________________________________________________________________________________________________
XmNborderWidth XmCBorderWidth Dimension 0 CSG
________________________________________________________________________________________________________________
XmNcolormap XmCColormap Colormap dynamic CG
________________________________________________________________________________________________________________
XmNdepth XmCDepth int dynamic CG
________________________________________________________________________________________________________________
XmNdestroyCallback XmCCallback XtCallbackList NULL C
________________________________________________________________________________________________________________
XmNheight XmCHeight Dimension dynamic CSG
________________________________________________________________________________________________________________
XmNinitialResourcesPersistent XmCInitialResourcesPersistent Boolean True C
________________________________________________________________________________________________________________
XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG
________________________________________________________________________________________________________________
XmNscreen XmCScreen Screen * dynamic CG
________________________________________________________________________________________________________________
XmNsensitive XmCSensitive Boolean True CSG
________________________________________________________________________________________________________________
XmNtranslations XmCTranslations XtTranslations dynamic CSG
10/89 Page 11
XmText(3X) UNIX System V XmText(3X)
|_____________________________|_______________________________|________________|______________________|________|
|XmNwidth | XmCWidth | Dimension | dynamic | CSG |
|_____________________________|_______________________________|________________|______________________|________|
|XmNx | XmCPosition | Position | 0 | CSG |
|_____________________________|_______________________________|________________|______________________|________|
|XmNy | XmCPosition | Position | 0 | CSG |
|_____________________________|_______________________________|________________|______________________|________|
Callback Information
A pointer to the following structure is passed to each callback:
typedef struct
{
int reason;
XEvent * event;
} XmAnyCallbackStruct;
reason Indicates why the callback was invoked
event Points to the XEvent that triggered the callback
The Text widget defines a new callback structure for use with
verification callbacks. Note that not all fields are relevant for every
callback reason. The application must first look at the reason field and
use only the structure members that are valid for the particular reason.
A pointer to the following structure is passed 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 Indicates why the callback was invoked.
event Points to the XEvent that triggered the callback.
doit Indicates whether the action that invoked the callback is
performed. Setting doit to False negates the action.
Page 12 10/89
XmText(3X) UNIX System V XmText(3X)
currInsert
Indicates the current position of the insert cursor.
newInsert
Indicates the position at which the user attempts to position the
insert cursor.
startPos
Indicates the starting position of the text to modify. If the
callback is not a modify verification callback, this value is the
same as currInsert.
endPos Indicates the ending position of the text to modify. If no text is
replaced or deleted, the value is the same as startPos. If the
callback is not a modify verification callback, this value is the
same as currInsert.
text Points to a structure of type XmTextBlockRec. This structure holds
the textual information 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 (for example, FMT8BIT).
The following table describes the reasons why the individual
verification callback structure fields are valid:
____________________________________________________
Reason Valid Fields
____________________________________________________
XmCRLOSINGFOCUS reason, event, doit,
currInsert, newInsert,
startPos, endPos
XmCRMODIFYINGTEXTVALUE reason, event, doit,
currInsert, newInsert,
startPos, endPos, text
XmCRMOVINGINSERTCURSOR reason, event, doit,
currInsert, newInsert
____________________________________________________
10/89 Page 13
XmText(3X) UNIX System V XmText(3X)
| | |
| | |
Tr
|anslations | |
| XmText includes translatio
|ns from XmPrimitive. The
| XmText translations
| are listed below. These t
|ranslations may not direc
|tly correspond to a
| translation table. The ac
|tions represent the effec
|tive behavior of the
| associated events, and the
|y may differ in a right-t
|o-left language
| environment. | |
| | |
| BSelect Press: grab-focus(
|) |
| BSelect Motion:extend-adju
|st() |
| BSelect Release:extend-end
|() |
| | |
| BExtend Press: extend-star
|t() |
| BExtend Motion:extend-adju
|st() |
| BExtend Release:extend-end
|() |
| | |
| BToggle Press: move-destin
|ation() |
| | |
| BDrag Press: secondary-s
|tart() |
| BDrag Motion: secondary-a
|djust() |
| BDrag Release: copy-to() | |
| | |
| MCtrl BDrag Press:secondar
|y-start() |
| MCtrl BDrag Motion:seconda
|ry-adjust() |
| MCtrl BDrag Release:copy-t
|o() |
| | |
| MAlt BDrag Press:secondary
|-start() |
| MAlt BDrag Motion:secondar
|y-adjust() |
| MAlt BDrag Release:move-to
|() |
| | |
| KUp: process-up(
|) |
| MShift KUp: process-shi
|ft-up() |
| MCtrl KUp: backward-pa
|ragraph() |
| MShift MCtrl KUp:backward†paragraph(extend) |
| | |
| KDown: process-dow
|n() |
| MShift KDown: process-shi
|ft-down() |
MCtrl KDown: forward-paragraph()
MShift MCtrl KDown:forward-paragraph(extend)
KLeft: backward-character()
MShift KLeft: key-select(left)
MCtrl KLeft: backward-word()
MShift MCtrl KLeft:backward-word(extend)
KRight: forward-character()
MShift KRight: key-select(right)
MCtrl KRight: forward-word()
MShift MCtrl KRight:forward-word(extend)
Page 14 10/89
XmText(3X) UNIX System V XmText(3X)
KPageUp: previous-page()
MShift KPageUp:previous-page(extend)
KPageDown: next-page()
MShift KPageDown:next-page(extend)
KPageLeft: page-left()
KPageRight: page-right()
KBeginLine: beginning-of-line()
MShift KBeginLine:beginning-of-line(extend)
KEndLine: end-of-line()
MShift KEndLine:end-of-line(extend)
KBeginData: beginning-of-file()
MShift KBeginData:beginning-of-file(extend)
KEndData: end-of-file()
MShift KEndData:end-of-file(extend)
KTab: process-tab()
KNextField: next-tab-group()
KPrevField: prev-tab-group()
KEnter: process-return()
KActivate: activate()
KDelete: delete-next-character()
KBackSpace: delete-previous-character()
KAddMode: toggle-add-mode()
KSpace: self-insert()
KSelect: set-anchor()
KExtend: key-select()
MAny KCancel: process-cancel()
KClear: clear-selection()
KSelectAll: select-all()
KDeselectAll: deselect-all()
KCut: cut-clipboard()
KCopy: copy-clipboard()
KPaste: paste-clipboard()
KPrimaryCut: cut-primary()
KPrimaryCopy: copy-primary()
KPrimaryPaste: copy-primary()
KQuickCut: quick-cut-set()
KQuickCopy: quick-copy-set()
KQuickPaste: quick-copy-set()
10/89 Page 15
XmText(3X) UNIX System V XmText(3X)
KQuickExtend: do-quick-action()
KHelp: Help()
KAny: self-insert()
Action Routines
The XmText action routines are described below:
activate():
Calls the callbacks for XmNactivateCallback.
backward-character():
Moves the insertion cursor one character to the left. For other
effects, see the description of navigation operations in the
"Keyboard Selection" section. This action may have different
behavior in a right-to-left language environment.
backward-paragraph(extend):
If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with
no argument, moves the insertion cursor to the first non-whitespace
character following the first previous blank line or beginning of
the text. If the insertion cursor is already at the beginning of a
paragraph, moves the insertion cursor to the beginning of the
previous paragraph. For other effects, see the description of
navigation operations in the "Keyboard Selection" section.
If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with
an argument of extend, moves the insertion cursor as in the case of
no argument and extends the selection. For other effects, see the
description of shifted navigation operations in the "Keyboard
Selection" section.
backward-word(extend):
If this action is called with no argument, moves the insertion
cursor to the first non-whitespace character after the first
whitespace character to the left or the beginning of the line. If
the insertion cursor is already at the beginning of a word, moves
the insertion cursor to the beginning of the previous word. For
other effects, see the description of navigation operations in the
"Keyboard Selection" section. This action may have different
behavior in a right-to-left language environment.
Page 16 10/89
XmText(3X) UNIX System V XmText(3X)
If called with an argument of extend, moves the insertion cursor as
in the case of no argument and extends the selection. For other
effects, see the description of shifted navigation operations in
the "Keyboard Selection" section.
beep():
Causes the terminal to beep.
beginning-of-file(extend):
If this action is called with no argument, moves the insertion
cursor to the beginning of the text. For other effects, see the
description of navigation operations in the "Keyboard Selection"
section.
If called with an argument of extend, moves the insertion cursor as
in the case of no argument and extends the selection. For other
effects, see the description of shifted navigation operations in
the "Keyboard Selection" section.
beginning-of-line(extend):
If this action is called with no argument, moves the insertion
cursor to the beginning of the line. For other effects, see the
description of navigation operations in the "Keyboard Selection"
section.
If called with an argument of extend, moves the insertion cursor as
in the case of no argument and extends the selection. For other
effects, see the description of shifted navigation operations in
the "Keyboard Selection" section.
clear-selection():
Clears the current selection by replacing each character except
<Return> with a <space> character.
copy-clipboard():
Copies the current selection to the clipboard.
copy-primary():
Copies the primary selection to the insertion cursor.
copy-to():
If a secondary selection exists, copies the secondary selection to
the insertion cursor. If no secondary selection exists, copies the
primary selection to the pointer location.
cut-clipboard():
Cuts the current selection to the clipboard.
cut-primary():
Cuts the primary selection to the insertion cursor.
10/89 Page 17
XmText(3X) UNIX System V XmText(3X)
delete-next-character():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection; otherwise, deletes the character
following the insertion cursor.
delete-next-word():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection; otherwise, deletes the characters
following the insertion cursor to the next space, tab or end of
line character.
delete-previous-character():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection; otherwise, deletes the character of
text immediately preceding the insertion cursor.
delete-previous-word():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection; otherwise, deletes the characters
preceding the insertion cursor to the next space, tab or beginning
of line character.
delete-selection():
Deletes the current selection.
delete-to-end-of-line():
Deletes the characters following the insertion cursor to the next
end of line character.
delete-to-start-of-line():
Deletes the characters preceding the insertion cursor to the
previous beginning of line character.
deselect-all():
Deselects the current selection.
do-quick-action():
Marks the end of a secondary selection. Performs the quick action
initiated by the quick-copy-set or quick-cut-set action.
end-of-file(extend):
If this action is called with no argument, moves the insertion
cursor to the end of the text. For other effects, see the
description of navigation operations in the "Keyboard Selection"
section.
If called with an argument of extend, moves the insertion cursor as
in the case of no argument and extends the selection. For other
effects, see the description of shifted navigation operations in
the "Keyboard Selection" section.
Page 18 10/89
XmText(3X) UNIX System V XmText(3X)
end-of-line(extend):
If this action is called with no argument, moves the insertion
cursor to the end of the line. For other effects, see the
description of navigation operations in the "Keyboard Selection"
section. If called with an argument of extend, moves the insertion
cursor as in the case of no argument and extends the selection.
For other effects, see the description of shifted navigation
operations in the "Keyboard Selection" section.
extend-adjust():
Selects text from the anchor to the pointer position and deselects
text outside that range. Moving the pointer over several lines
selects text from the anchor to the end of each line the pointer
moves over and up to the pointer position on the current line.
extend-end():
Moves the insertion cursor to the position of the pointer.
extend-start():
Adjusts the anchor using the balance-beam method. Selects text
from the anchor to the pointer position and deselects text outside
that range.
forward-character():
Moves the insertion cursor one character to the right. For other
effects, see the description of navigation operations in the
"Keyboard Selection" section. This action may have different
behavior in a right-to-left language environment.
forward-paragraph(extend):
If XmNeditMode is XmMULTI_LINE_EDIT, and this action is called with
no argument, moves the insertion cursor to the first non-whitespace
character following the next blank line. If the insertion cursor
is already at the beginning of a paragraph, moves the insertion
cursor to the beginning of the next paragraph. For other effects,
see the description of navigation operations in the "Keyboard
Selection" section.
If XmNeditMode is XmMULTI_LINE_EDIT and this action is called with
an argument of extend, moves the insertion cursor as in the case of
no argument and extends the selection. For other effects, see the
description of shifted navigation operations in the "Keyboard
Selection" section.
forward-word(extend):
If this action is called with no argument, moves the insertion
cursor to the first whitespace character or end of line following
the next non-whitespace character. If the insertion cursor is
already at the end of a word, moves the insertion cursor to the end
of the next word. For other effects, see the description of
navigation operations in the "Keyboard Selection" section. This
action may have different behavior in a right-to-left language
10/89 Page 19
XmText(3X) UNIX System V XmText(3X)
environment.
If called with an argument of extend, moves the insertion cursor as
in the case of no argument and extends the selection. For other
effects, see the description of shifted navigation operations in
the "Keyboard Selection" section.
grab-focus():
This key binding performs the action defined in the
XmNselectionArray, depending on the number of multiple mouse
clicks. The default selection array ordering is one click to move
the insertion cursor to the pointer position, two clicks to select
a word, three clicks to select a line of text, and four clicks to
select all text. A single click also deselects any selected text
and sets the anchor at the pointer position.
Help():
Calls the callbacks for XmNhelpCallback if any exist. If there are
no help callbacks for this widget, this action calls the help
callbacks for the nearest ancestor that has them.
insert-string(string):
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Inserts string at the insertion
cursor.
key-select(direction):
If called with an argument of right, moves the insertion cursor one
character to the right and extends the selection. If called with
an argument of left, moves the insertion cursor one character to
the left and extends the selection. If called with no argument,
extends the selection. For other effects, see the description of
shifted navigation operations and KExtend in the "Keyboard
Selection" section.
kill-next-character():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Otherwise, kills the character
following the insertion cursor and stores the character in the cut
buffer.
kill-next-word():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Otherwise, kills the characters
following the insertion cursor to the next space, tab or end of
line character, and stores the characters in the cut buffer.
kill-previous-character():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Otherwise, kills the character of
text immediately preceding the insertion cursor and stores the
character in the cut buffer.
Page 20 10/89
XmText(3X) UNIX System V XmText(3X)
kill-previous-word():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Otherwise, kills the characters
preceding the insertion cursor to the next space, tab or beginning
of line character, and stores the characters in the cut buffer.
kill-selection():
Kills the currently selected text and stores the text in the cut
buffer.
kill-to-end-of-line():
Kills the characters following the insertion cursor to the next end
of line character and stores the characters in the cut buffer.
kill-to-start-of-line():
Kills the characters preceding the insertion cursor to the next
beginning of line character and stores the characters in the cut
buffer.
move-destination():
Moves the insertion cursor to the pointer position without changing
any existing selection. If no selection exists, also moves the
destination cursor to the pointer position.
move-to():
If a secondary selection exists, cuts the secondary selection to
the insertion cursor. If no secondary selection exists, cuts the
primary selection to the pointer location.
newline():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Inserts a newline at the insertion
cursor.
newline-and-backup():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Inserts a newline and repositions
the insertion cursor to the end of the line before the newline.
newline-and-indent():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Inserts a newline and then the same
number of whitespace characters as at the beginning of the previous
line.
next-line():
Moves the insertion cursor to the next line. For other effects,
see the description of navigation operations in the "Keyboard
Selection" section.
10/89 Page 21
XmText(3X) UNIX System V XmText(3X)
next-page(extend):
If this action is called with no argument, moves the insertion
cursor forward one page. For other effects, see the description of
navigation operations in the "Keyboard Selection" section.
If called with an argument of extend, moves the insertion cursor as
in the case of no argument and extends the selection. For other
effects, see the description of shifted navigation operations in
the "Keyboard Selection" section.
next-tab-group():
Traverses to the next tab group.
page-left():
Scrolls the viewing window left one page of text.
page-right():
Scrolls the viewing window right one page of text.
paste-clipboard():
Pastes the contents of the clipboard before the insertion cursor.
prev-tab-group():
Traverses to the previous tab group.
previous-line():
Moves the insertion cursor to the previous line. For other
effects, see the description of navigation operations in the
"Keyboard Selection" section.
previous-page(extend):
If this action is called with no argument, moves the insertion
cursor back one page. For other effects, see the description of
navigation operations in the "Keyboard Selection" section.
If called with an argument of extend, moves the insertion cursor as
in the case of no argument and extends the selection. For other
effects, see the description of shifted navigation operations in
the "Keyboard Selection" section.
process-cancel():
Cancels the current extend-adjust() or secondary-adjust() operation
and leaves the selection state as it was before the operation.
process-down():
If XmNeditMode is XmSINGLE_LINE_EDIT and XmNnavigationType is
XmNONE, traverses to the widget below the current one in the tab
group.
If XmNeditMode is XmMULTI_LINE_EDIT, moves the insertion cursor
down one line. For other effects, see the description of
navigation operations in the "Keyboard Selection" section.
Page 22 10/89
XmText(3X) UNIX System V XmText(3X)
process-home():
Moves the insertion cursor to the beginning of the line. For other
effects, see the description of navigation operations in the
"Keyboard Selection" section.
process-return():
If XmNeditMode is XmSINGLE_LINE_EDIT, calls the callbacks for
XmNactivateCallback. If XmNeditMode is XmMULTI_LINE_EDIT, inserts
a newline.
process-shift-down():
If XmNeditMode is XmMULTI_LINE_EDIT, moves the insertion cursor
down one line. For other effects, see the description of
navigation operations in the "Keyboard Selection" section.
process-shift-up():
If XmNeditMode is XmMULTI_LINE_EDIT, moves the insertion cursor up
one line. For other effects, see the description of navigation
operations in the "Keyboard Selection" section.
process-tab():
If XmNeditMode is XmSINGLE_LINE_EDIT, traverses to the next tab
group. If XmNeditMode is XmMULTI_LINE_EDIT, inserts a tab.
process-up():
If XmNeditMode is XmSINGLE_LINE_EDIT and XmNnavigationType is
XmNONE, traverses to the widget above the current one in the tab
group.
If XmNeditMode is XmMULTI_LINE_EDIT, moves the insertion cursor up
one line. For other effects, see the description of navigation
operations in the "Keyboard Selection" section.
quick-copy-set():
Marks the beginning of a secondary selection for use in quick copy.
quick-cut-set():
Marks the beginning of a secondary selection for use in quick cut.
redraw-display():
Redraws the contents of the text window.
scroll-one-line-down():
Scrolls the text area down one line.
scroll-one-line-up():
Scrolls the text area up one line.
secondary-adjust():
Extends the secondary selection to the pointer position.
10/89 Page 23
XmText(3X) UNIX System V XmText(3X)
secondary-notify():
Copies the secondary selection to the destination cursor.
secondary-start():
Marks the beginning of a secondary selection.
select-adjust():
Extends the selection. The amount of text selected depends on the
number of mouse clicks, as specified by the XmNselectionArray
resource.
select-all():
Selects all text.
select-end():
Extends the selection. The amount of text selected depends on the
number of mouse clicks, as specified by the XmNselectionArray
resource.
select-start():
Marks the beginning of a new selection region.
self-insert():
If XmNpendingDelete is True and the cursor is inside the selection,
deletes the entire selection. Inserts the character associated
with the key pressed at the insertion cursor.
set-anchor():
Resets the anchor point for extended selections. Resets the
destination of secondary selection actions.
set-insertion-point():
Sets the insertion position.
set-selection-hint():
Sets the text source and location of the selection.
toggle-add-mode():
Toggles the state of Add Mode.
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.
Page 24 10/89
XmText(3X) UNIX System V XmText(3X)
Additional Behavior
This widget has the additional behavior described below:
<FocusIn>:
Draws the insertion cursor and starts blinking the cursor.
<FocusOut>:
Stops blinking the cursor.
Virtual Bindings
The bindings for virtual keys are vendor specific. For information about
bindings for virtual buttons and keys, see VirtualBindings(3X).
RELATED INFORMATION
Core(3X), XmCreateScrolledText(3X), XmCreateText(3X),
XmFontListCreate(3X), XmPrimitive(3X), XmTextClearSelection(3X),
XmTextCopy(3X), XmTextCut(3X), XmTextField(3X), XmTextGetBaseline(3X),
XmTextGetEditable(3X), XmTextGetInsertionPosition(3X),
XmTextGetLastPosition(3X), XmTextGetMaxLength(3X),
XmTextGetSelection(3X), XmTextGetSelectionPosition(3X),
XmTextGetSource(3X), XmTextGetString(3X), XmTextGetTopCharacter(3X),
XmTextInsert(3X), XmTextPaste(3X), XmTextPosToXY(3X), XmTextPosition(3X),
XmTextRemove(3X), XmTextReplace(3X), XmTextScroll(3X),
XmTextSetAddMode(3X), XmTextSetEditable(3X), XmTextSetHighlight(3X),
XmTextSetInsertionPosition(3X), XmTextSetMaxLength(3X),
XmTextSetSelection(3X), XmTextSetSource(3X), XmTextSetString(3X),
XmTextSetTopCharacter(3X), XmTextShowPosition(3X), and XmTextXYToPos(3X).
10/89 Page 25