Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ TextEdit(3w) — unbundled OpenWindows_3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

TextEdit(3w)  —  OLIT Widget Set

NAME

TextEdit − text edit widget

SYNOPSIS

#include <stdio.h>
#include <Xol/buffutil.h>
#include <Xol/textbuff.h>
#include <X11/Intrinsic.h>
#include <Xol/OpenLook.h>
#include <Xol/TextEdit.h>
 . . .
Widget my_textedit, my_parent;
String my_name;
ArgList args;
Cardinal num_args;

my_textedit =  XtCreate( my_name, textEditWidgetClass,

my_parent, args, num_args);

DESCRIPTION

The TextEdit widget provides a multi-line text editing facility that has both a customizable user interface and a programmatic interface. 

  Figure 1 Simple TextEdit Widget

It can be used for single line string entry as well as full-window editing.  It provides a consistent editing paradigm for textual data. 

The TextEdit widget provides three text wrap modes: wrapoff, wrapany, and wrapwhitespace. 

The TextEdit widget provides several distinct callback lists used to monitor the state of the textual data: insertion cursor movement, modification of the text, and post modification notification.  Each of these callbacks provide information to the application regarding the intended action.  The application can simply examine this information to maintain its current state or can disallow the action and perform any of the programmatic manipulations instead. 

The TextEdit widget also provides distinct callback lists for user input: mouse button down and key press.  The call data for these callbacks decodes the input for the application.  The application can examine the input and either consume the action, and perform any of the programmatic manipulations, or allow the widget to act upon it. 

The TextEdit widget also provides the application with a callback list used when the widget is redisplayed.  With this callback the application can add callbacks which can be used to display information in the margins of the TextEdit such as line numbers or update marks. 

Editing Capabilities

The TextEdit widget provides editing capabilities to move the insert point, select text, delete text, scroll the display, perform cut, copy, paste, and undo operations, and refresh the text display.  All of these capabilities are bound to global resources stored in the X server.  All of these settings dynamically change immediately after new settings are stored in the server.

The key bindings used by TextEdit are listed in the following table. 

  Table 1 Text Database Key Bindings

TextEdit   Key           Bindings
Command    Name          Virtual       Expression
=
CHARBAK    charBakKey    OL_CHARBAK    <Left>
_
CHARFWD    charFwdKey    OL_CHARFWD    <Right>
_
DELCHARBAK delCharBakKey OL_DELCHARBAK <BackSpace>,<Delete>
_
DELCHARFWD delCharFwdKey OL_DELCHARFWD s<BackSpace>,s<Delete>
_
DELLINE    delLineKey    OL_DELLINE    m<BackSpace>,m<Delete>
_
DELLINEBAK delLineBakKey OL_DELLINEBAK c<BackSpace>
_
DELLINEFWD delLineFwdKey OL_DELLINEFWD c<Delete>
_
DELWORDBAK delWordBakKey OL_DELWORDBAK c
_
DELWORDFWD delWordFwdKey OL_DELWORDFWD c
_
DOCEND     docEndKey     OL_DOCEND     c<R13>
_
DOCSTART   docStartKey   OL_DOCSTART   c<R7>
_
LINEEND    lineEndKey    OL_LINEEND    n<R13>
_
LINESTART  lineStartKey  OL_LINESTART  n<R7>
_
PANEEND    paneEndKey    OL_PANEEND    c
_
PANESTART  paneStartKey  OL_PANESTART  c
_
RETURN     returnKey     OL_RETURN     <Return>
_
ROWDOWN    rowDownKey    OL_ROWDOWN    <Down>
_
ROWUP      rowUpKey      OL_ROWUP      <Up>
_
WORDBAK    wordBakKey    OL_WORDBAK    c<Left>
_
WORDFWD    wordFwdKey    OL_WORDFWD    c<Right>

Text Hierarchy

Text is considered to be hierarchically composed of white space, words, lines and paragraphs. 

white space – is any non-empty sequence of the ASCII characters space, tab, linefeed or carriage return (decimal values of 32, 9, 10, 13, respectively)

a word – is any non-empty sequence of characters bounded on both sides by whitespace .

a source line – is any (possibly empty) sequence of characters bounded by newline characters.

a display line – is any (possibly empty) sequence of characters appearing on a single screen display line.

a source paragraph – is any sequence of characters bounded by sets of two or more adjacent newline characters.

a display paragraph – is any (possibly empty) sequence of characters bounded by newline characters ( This is the same definition as source line.)

In all cases, the beginning or end of the edit text is an acceptable bounding element in the previous definitions

Sizing the Display

When making display decisions, the TextEdit widget first will use either the application specified width and height or, if these values are not specified, calculate width and height by applying the values of the XtNcharsVisible and XtNlinesVisible resources.  Once the width and height are determined the TextEdit widget will request an appropriate size from its parent (considering the margins).  If the request is denied or only partially satisfied, no future growth requests will be made unless there is an intervening resize operation externally imposed. 

Once the size of the display is settled, the TextEdit widget calculates the display lines based on this size, the various margins, the font, tab table, and wrap mode. 

Wrapping

If the wrap mode is OL_WRAP_ANY, as many characters from the source line as will entirely fit before the right margin are written to the current display line, then the next character starts at the left margin of the next display line, and so on. 

If the wrap mode is OL_WRAP_WHITE_SPACE,‘ the line wrap occurs at the first whitespace character that follows the last full word that does fit on the current display line.  If, however, under OL_WRAP_WHITE_SPACE, the first full word that does not fit is the first word on the display line, the wrap is made as if OL_WRAP_ANY were selected. 

If the wrap mode is OL_WRAP_OFF the lines are not wrapped but are clipped at the right margin.  In this mode the text is horizontally scrollable. 

ScrolledWindow

The application can place the TextEdit widget within a ScrolledWindow widget.  When this arrangement is used, the text is easily scrollable using the Scrollbars provided by the ScrolledWindow. 

The proportion indicators on the scrollbars show relatively how much of the text is currently in the display. 

As the user enters text, the view automatically scrolls when the insert point moves beyond a margin boundary (right or bottom) to keep the insert point in view. 

Application Access

The TextEdit widget provides complete programmatic control of the text and its display. 

Keyboard Traversal

The default value of the XtNtraversalOn resource is TRUE. 

The widget responds to the following keyboard navigation keys:

—NEXT_FIELD moves to the first control in the next group

—PREV_FIELD moves to the first control in the previous group

—NEXTWINDOW moves to the next window in the application

—PREVWINDOW moves to the previous window in the application

—NEXTAPP moves to the first window in the next application

—PREVAPP moves to the first window in the previous application

—ROWUP moves the caret up one line in the current column

—ROWDOWN moves the caret down one line in the current column

—CHARBAK moves the caret backward one character

—CHARFWD moves the caret forward one character

—WORDFWD moves the caret forward one word

—WORDBAK moves the caret back one word

—LINESTART moves the caret to the beginning of the line

—LINEEND moves the caret to the end of the line

—PANESTART moves the caret to the first row and column on the display

—PANEEND moves the caret to the last row and column on the display

—DOCSTART moves the caret to the beginning of the document

—DOCEND moves the caret to the end of the document

NOTE: It is expected that the user will use the alternate bindings for NEXT_FIELD and PREV_FIELD because the primary binding, <Tab> and <Shift><Tab>, are valid characters in a Text pane. 

The TextEdit widget responds to the following selection keys:

—SELCHARFWD adjusts the selection one character forward

—SELWORDFWD adjusts the selection to the end of the current (or next) word

—SELLINEFWD adjusts the selection to the end of the current (or next) line

—SELCHARBAK adjusts the selection one character backward

—SELWORDBAK adjusts the selection to the beginning of the current (or previous) word

—SELLINEBAK adjusts the selection to the beginning of the current (or previous) line

—SELLINE adjusts the selection to include the entire current line

—SELFLIPENDS reverses the "anchor" and cursor position of the selection

The TextEdit widget responds to the following scrolling keys:

—SCROLLUP scroll the view up one screen line

—SCROLLDOWN scroll the view down one screen line

—PAGEUP scroll to the next page up

—PAGEDOWN scroll to the next page down

—PAGERIGHT scroll to the next page to the right

—PAGELEFT scroll to the next page to the left

—SCROLLLEFT scroll the view one screen to the left

—SCROLLRIGHT scroll the view one screen to the right

—SCROLLTOP scroll to the beginning of the document

—SCROLLBOTTOM scroll to the end of the document

—SCROLLLEFTEDGE scroll to the left edge of the document

—SCROLLRIGHTEDGE scroll to the right edge of the document

The TextEdit widget responds to the following edit keys:

—DELCHARFWD deletes the character to the right of the caret

—DELCHARBAK deletes the character to the left of the caret

—DELWORDFWD deletes the word to the right of the caret

—DELWORDBAK deletes the word to the left of the caret

—DELLINEFWD deletes to the end of the line from the caret

—DELLINEBAK deletes from the beginning of the line to the caret

—DELLINE deletes the line containing the caret

—UNDO undoes the previous edit operatio

Coloration

When this widget receives the input focus, it changes the text caret in the text field to the active caret and the color specified in XtNinputFocusColor. 

Keyboard Mnemonic Display

The TextEdit does not display the mnemonic.  If the TextEdit widget is the child of a Caption widget, the Caption widget can be used to display the mnemonic. 

Keyboard Accelerators Display

The TextEdit does not display the keyboard accelerator.  If the TextEdit is the child of a Caption widget, the Caption widget can be used to display the accelerator as part of the label. 

RESOURCES

  Table 2 TextEdit Resource Summary

TextEdit                  Resource       Set
Name                      Type           Default              Access
 
XtNaccelerator            String         NULL                 SGI
XtNacceleratorText        String         DYNAMIC              SGI
XtNancestorSensitive      Boolean        DYNAMIC              G
XtNbackground             Pixel          XtDefaultBackground  SGI
XtNbackgroundPixmap       Pixmap         Unspecified          SGI
XtNblinkRate              Int            1000                 SGI
XtNborderColor            Pixel          XtDefaultForeground  SGI
XtNborderPixmap           Pixmap         Unspecified          SGI
XtNborderWidth            Dimension      0                    SGI
XtNbottomMargin           Dimension      4                    SGI
XtNbuttons                XtCallbackList NULL                 SGI
XtNcharsVisible           Int            50                   GI
XtNcolormap               Pointer        DYNAMIC              G
XtNconsumeEvent           XtCallbackList NULL                 SGI
XtNcursorPosition         Int            0                    SGI
XtNdepth                  Int            DYNAMIC              GI
XtNdisplayPosition        Int            0                    SGI
XtNeditType               OlEditType     OL_TEXT_EDIT         SGI
XtNfont                   FontStruct     OPEN                 LOOK
XtNfontColor              Pixel          XtDEfaultFopreground SGI
XtNheight                 Dimension      0                    SGI
XtNgrowMode               OlDefine       OL_GROW_OFF          SGI
XtNinputFocusColor        Pixel          Red                  SGI
XtNinsertTab              Boolean        TRUE                 SGI
XtNkeys                   XtCallbackList NULL                 SGI
XtNleftMargin             Dimension      4                    SGI
XtNlinesVisible           Int            16                   GI
XtNmappedWhenManaged      Boolean        TRUE                 SGI
XtNmargin                 XtCallbackList NULL                 SGI
XtNmnemonic               unsigned       char                 NULL
XtNmodifyVerification     XtCallbackList NULL                 SGI
XtNmotionVerification     XtCallbackList NULL                 SGI
XtNpostModifyNotification XtCallbackList NULL                 SGI
XtNreferenceName          String         NULL                 SGI
XtNreferenceWidget        Widget         NULL                 SGI
XtNrightMargin            Dimension      4                    SGI
XtNscreen                 Pointer        DYNAMIC              G
XtNselectEnd              Int            0                    SGI
XtNselectStart            Int            0                    SGI
XtNsensitive              Boolean        TRUE                 GI
XtNsource                 String         NULL                 SGI
XtNsourceType             OlSourceType   OL_STRING_SOURCE     SGI
XtNtabTable               Pointer        NULL                 SGI
XtNtopMargin              Dimension      4                    SGI
XtNtraversalOn            Boolean        TRUE                 SGI
XtNuserData               Pointer        NULL                 Pointer
XtNwidth                  Dimension      0                    SGI
XtNwrapMode               OlWrapMode     OL_WRAP_WHITE_SPACE  SGI
XtNx                      Position       0                    SGI
XtNy                      Position       0                    SGI

Access:S = XtSetValues G = XtGetValues
        I = init timeO = other access
† see resources3w

XtNblinkRate

 class:XtCBlinkRate type:int default:1000access:SGI

Action: specifies the rate that the active input caret blinks. 

The value of this resource is interpreted as the number of milliseconds between blinks.  Setting this value to zero (0) turns the blink effect off. 

XtNbottomMargin

 class:XtCMargin type:Dimension default:4access:SGI

Action: specifies the number of pixels used for the bottom margin. 

Values: 1 ≤ XtNbottomMargin ≤ height − XtNtopMargin − font_height

Note that the range is relative to the top margin value. 

XtNbuttons

 class:XtCCallback type:XtCallbackList default:NULLaccess:SGI

Action: gives the callback list used when a mouse button press is made in the pane. 

The call_data parameter is a pointer to an OlInputCallData structure:

 typedef enum {
   OL_UNKNOWN_INPUT,
   OL_UNKNOWN_BTN_INPUT,
   OL_SELECT, OL_ADJUST, OL_MENU,
   OL_CONSTRAIN, OL_DUPLICATE, OL_PAN,
   OL_UNKNOWN_KEY_INPUT,
   OL_CUT, OL_COPY, OL_PASTE,
   OL_HELP, OL_CANCEL, OL_PROP, OL_STOP, OL_UNDO,
   OL_NEXT_FIELD, OL_PREV_FIELD,
   OL_CHARFWD, OL_CHARBAK,
   OL_ROWDOWN, OL_ROWUP,
   OL_WORDFWD, OL_WORDBAK,
   OL_LINESTART, OL_LINEEND,
   OL_DOCSTART, OL_DOCEND,
   OL_PANESTART, OL_PANEEND,
   OL_DELCHARFWD, OL_DELCHARBAK,
   OL_DELWORDFWD, OL_DELWORDBAK,
   OL_DELLINEFWD, OL_DELLINEBAK, OL_DELLINE,
   OL_SELCHARFWD, OL_SELCHARBAK,
   OL_SELWORDFWD, OL_SELWORDBAK,
   OL_SELLINEFWD, OL_SELLINEBAK, OL_SELLINE,
   OL_SELFLIPENDS,
   OL_REDRAW, OL_RETURN,
   OL_PAGEUP, OL_PAGEDOWN,
   OL_HOME, OL_END,
   OL_SCROLLUP, OL_SCROLLDOWN,
   OL_SCROLLLEFT, OL_SCROLLRIGHT,
   OL_SCROLLLEFTEDGE, OL_SCROLLRIGHTEDGE,
   OL_PGM_GOTO,
 } OlInputEvent;
 typedef struct {
   Boolean          consumed;
   XEvent ∗         event;
   KeySym ∗         keysym;
   char ∗∗          buffer;
   OlInputEvent     ol_event;
 } OlInputCallData, ∗OlInputCallDataPointer;

This callback can be used to remap or consume button events.  For example, this callback may be used to override the default Edit menu.  To do so, the application would add a XtNbuttons callback that checks the ol_event member of the OlInputCallData structure.  If the value of the ol_event member is OL_MENU, the callback posts the application-defined menu and sets the member of the OlInputCallData structure to TRUE. 

XtNcharsVisible

 class:XtCCharsVisible type:int default:0access:SGI
 class:XtCCharsVisibletype:intdefault:0access:SGI


 

Action: specifies the initial width of the text in terms of characters.

This resource overrides the XtNwidth resource setting. The XtNwidth is recalculated to be the value of XtNcharsVisible multiplied by the width of the “n” (en) character in the font plus the values for the left and right margins.  The value of this resource changes to reflect the effects of geometry changes imposed by the widget tree and the user.  SetValues for this resource is ignored. 

XtNcursorPosition

 class:XtCTestPosition type:int default:0access:SGI

Action: specifies the relative character position in the text source of the insert cursor. 

Values: 0 ≤ cursorPosition < size of buffer

Changing the value of this resource may affect the XtNdisplayPosition resource if the cursorPosition is not visible in the pane.

XtNdisplayPosition

 class:XtCTextPosition type:int default:0access:SGI
 class:XtCTextPositiontype:intdefault:0access:SGI


 

Action: contains the position in the text source that will be displayed at the top of the pane. 

Values: 0 ≤ displayPosition < size of buffer

A value of 0 indicates the beginning of the text source.  When the position is near the end of the buffer, this position is recalculated to ensure that the last line in the buffer appears as the last line in the pane. 

XtNeditType

 class:XtCEditType type:OlEditType default:OL_TEXT_EDITaccess:SGI

Action: controls the edit state of the source. 

Values: OL_TEXT_READ – the source is read-only; the end-user cannot edit it.  OL_TEXT_EDIT – the source is fully editable.

XtNfont

 class:XtCFont type:FontStruct∗ default:OPEN LOOK Fontaccess:SGI

Action: specifies the font to be used to display text within the widget. 

Values: (Valid XFontStruct ∗) / (Valid font name)

XtNfontColor

 class:XtCFontColor type:Pixel default:XtDEfaultFopregroundaccess:SGI

Action: specifies the color of the text. 

Values: (Valid Pixel value for the display) / (Valid color name)

Normally, this color is derived from the value of the XtNtextEditFontColor resource and is dynamically maintained.  This dynamic behavior is abandoned if the application explicitly sets this resource either at initialization or through an XtSetValues. 

XtNgrowMode

 class:XtCGrowMode type:OlDefine default:OL_GROW_OFFaccess:SGI

Action: controls the resize-policy of the widget

Values:

OL_GROW_OFF – does not grow either horizontally or vertically when text exceeds window boundaries. 

OL_GROW_HORIZONTAL – grows horizontally, if text exceeds window’s width. Note that this setting is valid only when OL_WRAP_OFF

OL_GROW_VERTICAL – grows vertically, if text exceeds window’s height. 

OL_GROW_BOTH – grows both horizontally and vertically as required, if text exceeds window width or height.  Note that this setting is valid only when XtNwrapMode is OL_WRAP_OFF. 

XtNinputFocusColor

 class:XtCInputFocusColor type:Pixel default:Blackaccess:SGI
 class:XtCInputFocusColortype:Pixeldefault:Blackaccess:SGI


 

Action: specifies the color of the input caret. 

Values: (Valid Pixel value for the display) / (Valid color name)

Normally, this color is derived from the value of the XtNinputFocusColor resource and is dynamically maintained.  This dynamic behavior is abandoned if the application explicitly sets this resource either at initialization or through an XtSetValues. 

XtNinsertTab

 class:XtCInsertTab type:Boolean default:TRUEaccess:SGI

Action: determines whether or not a TAB character is insertable. 

Values: TRUE – a TAB character is insertable.  FALSE – a TAB character is not insertable. Setting this resource to FALSE makes traversal of the controls easier if the TAB key is bound as OL_NEXT_FIELD.

XtNkeys

 class:XtCCallback type:XtCallbackList default:NULLaccess:SGI
 class:XtCCallbacktype:XtCallbackListdefault:NULLaccess:SGI


 

Action: gives the callback list used when a key press is made in the pane. 

The call_data parameter is a pointer to an OlInputCallData structure:

 typedef enum {
   OL_UNKNOWN_INPUT,
   OL_UNKNOWN_BTN_INPUT,
   OL_SELECT, OL_ADJUST, OL_MENU,
   OL_CONSTRAIN, OL_DUPLICATE, OL_PAN,
   OL_UNKNOWN_KEY_INPUT,
   OL_CUT, OL_COPY, OL_PASTE,
   OL_HELP, OL_CANCEL, OL_PROP, OL_STOP, OL_UNDO,
   OL_NEXT_FIELD, OL_PREV_FIELD,
   OL_CHARFWD, OL_CHARBAK,
   OL_ROWDOWN, OL_ROWUP,
   OL_WORDFWD, OL_WORDBAK,
   OL_LINESTART, OL_LINEEND,
   OL_DOCSTART, OL_DOCEND,
   OL_PANESTART, OL_PANEEND,
   OL_DELCHARFWD, OL_DELCHARBAK,
   OL_DELWORDFWD, OL_DELWORDBAK,
   OL_DELLINEFWD, OL_DELLINEBAK, OL_DELLINE,
   OL_SELCHARFWD, OL_SELCHARBAK,
   OL_SELWORDFWD, OL_SELWORDBAK,
   OL_SELLINEFWD, OL_SELLINEBAK, OL_SELLINE,
   OL_SELFLIPENDS,
   OL_REDRAW, OL_RETURN,
   OL_PAGEUP, OL_PAGEDOWN,
   OL_HOME, OL_END,
   OL_SCROLLUP, OL_SCROLLDOWN,
   OL_SCROLLLEFT, OL_SCROLLRIGHT,
   OL_SCROLLLEFTEDGE, OL_SCROLLRIGHTEDGE,
   OL_PGM_GOTO,
 } OlInputEvent;
 typedef struct {
   Boolean          consumed;
   XEvent ∗         event;
   KeySym ∗         keysym;
   char ∗∗          buffer;
   OlInputEvent     ol_event;
 } OlInputCallData, ∗OlInputCallDataPointer;

This callback can be used to remap or consume key events.  For example, this callback may be used to post a property window for the text.  To do so, the application would add a XtNkeys callback that checks the ol_event member of the OlInputCallData structure.  If the value of the ol_event member is OL_PROP, the callback posts the property window (or raises it if it’s already mapped) and sets the consumed member of the OlInputCallData structure to TRUE. 

XtNleftMargin

 class:XtCMargin type:Dimension default:4access:SGI
 class:XtCMargintype:Dimensiondefault:4access:SGI


 

Action: specifies the number of pixels used for the left margin. 

Note that the range is relative to the right margin value. 

XtNlinesVisible

 class:XtCLinesVisible type:int default:16access:GI

Action: specifies the initial height of the text in terms of lines.

This resource overrides the XtNheight resource setting. 

The XtNheight is recalculated to be the value of XtNlinesVisible multiplied by the height of the font plus the values for the top and bottom margins. 

The value of this resource changes to reflect the effects of geometry changes imposed by the widget tree and the user.  XtSetValues for this resource is ignored. 

XtNmargin

 class:XtCCallback type:XtCallbackList default:NULLaccess:SGI
 class:XtCCallbacktype:XtCallbackListdefault:NULLaccess:SGI


 

Action: gives the callback list used when the pane is redisplayed. 

The call_data parameter is a pointer to an OlTextMarginCallData structure:

 typedef enum {
   OL_MARGIN_EXPOSED,
   OL_MARGIN_CALCULATED,
}  OlTextMarginHint;
 typedef struct {
    OlTextMarginHint  hint;
    XRectangle ∗      rect;
}  OlTextMarginCallData, ∗OlTextMarginCallDataPointer;

The OlTextMarginHint indicates whether the area to be redrawn was explicitly known because of an exposure event (OL_MARGIN_EXPOSED) or if the rectangle was calculated relative to the textual display (OL_MARGIN_CALCULATED).  The margin callback should respond to the OL_MARGIN_EXPOSED hint by repainting the area defined by the XRectangle rect.

The margin callback may wish to calculate its own rectangle in the OL_MARGIN_CALCULATED case.  It can freely use the rectangle structure passed in with the call data for this purpose.  This callback can be used to repair the margins for the text.  For example, this callback may be used to display line numbers for the text in the left margin. 

XtNmodifyVerification

 class:XtCCallback type:XtCallbackList default:NULLaccess:SGI
 class:XtCCallbacktype:XtCallbackListdefault:NULLaccess:SGI


 

Action: gives the callback list used when a modification of the buffer is attempted. 

The call_data parameter is a pointer to an OlTextModifyCallData structure:

 typedef struct {
    Boolean           ok;
    TextPosition      current_cursor;
    TextPosition      select_start;
    TextPosition      select_end;
    TextPosition      new_cursor;
    TextPosition      new_select_start;
    TextPosition      new_select_end;
    char ∗            text;
    int               text_length;
 }  OlTextModifyCallData, ∗OlTextModifyCallDataPointer;

All of the fields in this structure, with the exception of the ok flag, are treated as read-only information.  The application can return without changing the value of the ok flag, in which case the update will occur.  The application can also set the ok flag to FALSE, perform any other operations it desires, and return, in which case the update will not be performed. 

XtNmotionVerification

 class:XtCCallback type:XtCallbackList default:NULLaccess:SGI
 class:XtCCallbacktype:XtCallbackListdefault:NULLaccess:SGI


 

Action: called whenever the cursor position moves within the widget. 

The call_data parameter is a pointer to an OlTextMotionCallData structure:

 typedef struct {
    Boolean           ok;
    TextPosition      current_cursor;
    TextPosition      new_cursor;
    TextPosition      select_start;
    TextPosition      select_end;
 }  OlTextMotionCallData, ∗OlTextMotionCallDataPointer;

This callback list is used whenever the cursor position changes due to cursor movement operations or by modification of the text. 

The application can distinguish between a simple cursor movement and a modify operation by comparing the current_cursor and new_cursor values. When these values are equal, the callback is the result of a modify operation. In this case the ok field is ignored and the application should not attempt to perform updates to the text or its display during this callback.

If the values of current_cursor and new_cursor are different, the application is guaranteed that the operation is the result of a cursor movement.  In this mode all of the fields in this structure, with the exception of the ok flag, are treated as read-only information.

The application can return without changing the value of the ok flag, in which case the movement will occur.

The application can also set the ok flag to FALSE, perform any other operations it desires, and return, in which case the movement will not be performed. 

XtNpostModifyNotification

 class:XtCCallback type:XtCallbackList default:NULLaccess:SGI
 class:XtCCallbacktype:XtCallbackListdefault:NULLaccess:SGI


 

Action: gives the callback list used after a buffer update has completed. 

The call_data parameter is a pointer to an OlTextPostModifyCallData structure:

 typedef struct {
    Boolean           requestor;
    TextPosition      new_cursor;
    TextPosition      new_select_start;
    TextPosition      new_select_end;
    char ∗            inserted;
    char ∗            deleted;
    TextLocation      delete_start;
    TextLocation      delete_end;
    TextLocation      insert_start;
    TextLocation      insert_end;
    TextLocation      cursor_position;
 }  OlTextPostModifyCallData, ∗OlTextFocusCallDataPointer;

This callback is used to synchronize the application with the text once a modify operation is completed.  For example, the application may record successful edit operations in an undo buffer to provide multi-level undo functionality.  The data provided in this callback is considered read-only and volatile (the application should copy what it needs from this structure before returning). 

XtNrightMargin

 class:XtCMargin type:Dimension default:4access:SGI

Action: specifies the size of the right margin, in pixels. 

Values: 1 ≤ XtNrightMargin  ≤ width  - XtNleftMargin - font_width

The range is relative to the left margin. 

XtNselectEnd

 class:XtCTextPosition type:int default:0access:SGI
 class:XtCTextPositiontype:intdefault:0access:SGI


 

Action: specifies the last character position selected in the text. 

This resource is used with XtNselectStart and XtNcursorPosition to specify a selection.  To be effective, the following conditions must pertain:

XtNselectStart ≤ XtNselectEnd

and either
XtNcursorPosition = XtNselectStart
or
XtNcursorPosition = XtNselectEnd

If either of these tests fails, then XtNselectStart and XtNselectEnd are set equal to the value of the XtNcursorPosition. 

XtNselectStart

 class:XtCTextPosition type:int default:0access:SGI

Action: specifies the first character position selected in the text. 

This resource is used with XtNselectEnd and XtNcursorPosition to specify a selection.  To be effective, the following conditions must pertain:

XtNselectStart ≤ XtNselectEnd

and either
XtNcursorPosition = XtNselectStart
or
XtNcursorPosition = XtNselectEnd

If either of these tests fails, then XtNselectStart and XtNselectEnd are set equal to the value of the XtNcursorPosition. 

XtNsource

 class:XtCSource type:String default:NULLaccess:SGI

Action: used with XtNsourceType to specify the source. 

See XtNsourceType. 

XtNsourceType

 class:XtCSourceType type:OlSourceType default:OL_STRING_SOURCEaccess:SGI

Action: controls the interpretation of the XtNsource resource value. 

Values: OL_STRING_SOURCE – the XtNsource value is interpreted as the string to be used as the source OL_DISK_SOURCE – the XtNsource value is interpreted as the name of the file containing the source OL_TEXT_BUFFER_SOURCE – the XtNsource value is interpreted as a pointer to a previously initialized TextBuffer (see the TextBufferUtilities(3W) for a description of TextBuffers). 

XtNtabTable

 class:XtCTabTable type:Pointer default:NULLaccess:SGI

Action: used to specify a pointer to an array of tab positions.

These tab positions are specified in terms of pixels and must be terminated by a zero (0) entry.  The widget calculates tabs by finding the next tab table entry that exceeds the current x offset for the line.  If no such entry exists in the table or if the pointer to the tab table is NULL, the tab is set to the next greater multiple of eight (8) times the size of the “n” (en) character in the font. 

XtNtopMargin

 class:XtCMargin type:Dimension default:4access:SGI
 class:XtCMargintype:Dimensiondefault:4access:SGI


 

Action: specifies the number of pixels used for the top margin. 

Note: the range is relative to the bottom margin value. 

XtNwrapMode

Action: controls how the source is wrapped in the pane. 

Values: OL_WRAP_ANY – lines are wrapped at the last character before the right margin; OL_WRAP_WHITE_SPACE – lines are wrapped at the last white space before the right margin or as in OL_WRAP_ANY if the line does not contain any white space; OL_WRAP_OFF – lines are not wrapped and the pane may horizontally scroll. 
 
 

SEE ALSO

textbuffer3w, textedit3w, textfield3w, textselection3w, textbuffer3w, StaticText3w, TextField3w
 

Version 3.0  —  19 July 91

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026