The widget library, libDtWidget, contains four widgets that combine or enhance functionality of existing Motif 1.2 widgets:
The Custom Widgets library depends directly on the following libraries:
Common Desktop Environment Motif adds functionality to the Motif 1.2.3 release while maintaining source compatibility. Common Desktop Environment Motif is source and binary compatible with Motif 1.2 applications. Existing Motif 1.2 applications will compile using Common Desktop Environment Motif. Existing Motif 1.2 binaries will run without modification using Common Desktop Environment Motif.
Common Desktop Environment Motif also provides four custom widgets not found in Motif 1.2. The custom widgets are described in detail in this chapter.
Include the uil/UilDef.h header file to access UIL.
Include the Mrm/MrmPublic.h header files to access libMrm in your application.
For information on these enhancements, see the XmDisplay(3), XmPushButton(3),XmPushButtonGadget(3),XmToggleButton(3), XmToggleButtonGadget(3), and XmScale(3) man pages.
The DtSpinBox widget is a user interface control used to increment and decrement an arbitrary text or numeric field. You can use it, for example, to cycle through the months of the year or days of the month. Figure 7-1 shows examples of the DtSpinBox widget.
Function | Description |
DtCreateSpinBox() |
Creats a SpinBox widget. |
DtSpinBoxAddItem() |
Adds an item into a DtSpinBox widget at a specified location. |
DtSpinBoxDeletePos() |
Deletes a specified item from a DtSpinBox widget. |
DtSpinBoxSetItem() |
Sets the current item in a DtSpinBox widget. |
The class pointer is dtSpinBoxWidgetClass.
The class name is DtSpinBoxWidget.
DtSpinBoxWidget does not support subclassing.
Name | Class | Type | Default | Access |
DtNarrowLayout |
DtCArrowLayout |
unsigned char |
DtARROWS_END |
CSG |
DtNarrowSensitivity |
DtCArrowSensitivity |
unsigned char |
DtARROWS_SENSITIVE |
CSG |
DtNspinBoxChildType |
DtCSpinBoxChildType |
unsigned char |
DtSTRING |
CG |
DtNdecimalPoints |
DtCDecimalPoints |
short |
0 |
CSG |
DtNincrementValue |
DtCIncrementValue |
int |
1 |
CSG |
DtNinitialDelay |
DtCInitialDelay |
unsigned int |
250 ms |
CSG |
DtNnumValues |
DtCNumValues |
int |
0 |
CSG |
DtNvalues |
DtCValues |
XmStringTable |
NULL |
CSG |
DtNmaximumValue |
DtCMaximumValue |
int |
10 |
CSG |
DtNminimumValue |
DtCMinimumValue |
int |
0 |
CSG |
DtNmodifyVerifyCallback |
DtCCallback |
XtCallbackList |
NULL |
C |
DtNposition |
DtCPosition |
int |
0 |
CSG |
DtNrepeatDelay |
DtCRepeatDelay |
unsigned int |
200 ms |
CSG |
DtNvalueChangedCallback |
DtCCallback |
XtCallbackList |
NULL |
C |
typedef struct {
int reason;
XEvent *event;
Widget widget;
Boolean doit;
int position;
XmString value;
Boolean crossed_boundary;
} DtSpinBoxCallbackStruct;
Callback | Description |
reason | Use this callback for three possible reasons. For the first call to
the callback at the beginning of a spin, or for a single activation of
the spin arrows, DtCR_OK is the reason. If the
DtSpinBox
is being continuously spun, the reason is DtCR_SPIN_NEXT or
DtCR_SPIN_PRIOR ,
depending on the arrow that is spinning. |
event | A pointer to the event that caused this callback to be invoked. It
can be NULL when the DtSpinBox is continuously spinning. |
widget | The widget identifier for the text widget that is affected by the spin. |
doit | Sets this value only when the call_data comes from the
DtNmodifyVerifyCallback . For a modifyVerify callback, the setting of this field by
an application determines whether the action that initialized the
callback should be performed. When this field is set to False ,
the action is not performed. |
position | The new value of the DtNposition resource that results from the
spin. |
value | The new XmString value displayed in the Text widget that
results from the spin. This string must be copied if it is used beyond
the scope of the call_data structure. |
crossed_boundary | This Boolean is True when the spinbox cycles, and/or
DtNspinBoxChildType of XmSTRING wraps from the
first item to the last or the last item to the first. When the
DtNspinBoxChildType is XmNUMERIC , the boundary
is crossed when DtSpinBox cycles from the maximum value to
the minimum value or vice versa. |
/* * Example code for SpinBox */
#include <Dt/SpinBox.h>
static char *spinValueStrings[] = { "alpha", "beta", "gamma", "delta", "epsilon", "zeta", "eta", "theta", "iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega" };
static void ModifyVerifyCb(Widget, XtPointer, XtPointer);
static void CreateSpinBoxes(Widget parent) { Widget titleLabel, spinBox; XmString *valueXmstrings; int numValueStrings; XmString labelString; Arg args[20]; int i, n;
/* Create value compound strings */ numValueStrings = XtNumber(spinValueStrings); valueXmstrings = (XmString *)XtMalloc(numValueStrings sizeof(XmString*)); for (i = 0; i < numValueStrings; i++) { valueXmstrings[i] = XmStringCreateLocalized(spinValueStrings[i]); }
/* Create title label */ labelString = XmStringCreateLocalized("SpinBox Widget"); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; titleLabel = XmCreateLabel(parent, "title", args, n); XtManageChild(titleLabel); XmStringFree(labelString);
/* * Create a SpinBox containing string values. */ n = 0; XtSetArg(args[n], DtNvalues, valueXmstrings); n++; XtSetArg(args[n], DtNnumValues, numValueStrings); n++; XtSetArg(args[n], DtNcolumns, 10); n++; spinBox = DtCreateSpinBox(parent, "spinBox1", args, n); XtManageChild(spinBox);
/* * Create a SpinBox containing numeric values to 3 decimal places. * Position the arrows on either side of the displayed value. */ n = 0; XtSetArg(args[n], DtNspinBoxChildType, DtNUMERIC); n++; XtSetArg(args[n], DtNminimumValue, 1000); n++; XtSetArg(args[n], DtNmaximumValue, 100000); n++; XtSetArg(args[n], DtNincrementValue,1000); n++; XtSetArg(args[n], DtNdecimalPoints,3); n++; XtSetArg(args[n], DtNposition,1000); n++; XtSetArg(args[n], DtNarrowLayout,DtARROWS_SPLIT); n++; XtSetArg(args[n], DtNcolumns, 10); n++; spinBox = DtCreateSpinBox(parent, "spinBox2", args, n); XtManageChild(spinBox);
/* * Create a SpinBox containing numeric values to 2 decimal places. * Position the arrows on the left of the displayed value. * Disallow alternate user changes by adding a modify/verify * callback. */ n = 0; XtSetArg(args[n], DtNspinBoxChildType, DtNUMERIC); n++; XtSetArg(args[n], DtNminimumValue, 1500); n++; XtSetArg(args[n], DtNmaximumValue, 60500); n++; XtSetArg(args[n], DtNincrementValue,1500); n++; XtSetArg(args[n], DtNdecimalPoints,2); n++; XtSetArg(args[n], DtNposition,7500); n++ XtSetArg(args[n], DtNarrowLayout,DtARROWS_FLAT_BEGINNING); n++; XtSetArg(args[n], DtNcolumns, 10); n++; spinBox = DtCreateSpinBox(parent, "spinBox3", args, n); XtManageChild(spinBox);
XtAddCallback(spinBox, DtNmodifyVerifyCallback, ModifyVerifyCb, NULL);
/* * Create a SpinBox containing string values. * Position the arrows on the left of the display value */
n = 0; XtSetArg(args[n], DtNvalues, valueXmstrings); n++; XtSetArg(args[n], DtNnumValues, numValueStrings); n++; XtSetArg(args[n], DtNarrowLayout, DtARROWS_BEGINNING); n++; XtSetArg(args[n], DtNcolumns, 10); n++; spinBox = DtCreateSpinBox(parent, "spinBox4", args, n); XtManageChild(spinBox);
/* * Create a SpinBox containing numeric values to 3 decimal places. * Position the arrows on the right of the displayed value. */ n = 0; XtSetArg(args[n], DtNspinBoxChildType, DtNUMERIC); n++; XtSetArg(args[n], DtNminimumValue, 1000); n++; XtSetArg(args[n], DtNmaximumValue, 100000); n++; XtSetArg(args[n], DtNincrementValue,1000); n++; XtSetArg(args[n], DtNdecimalPoints,3); n++; XtSetArg(args[n], DtNposition,1000); n++; XtSetArg(args[n], DtNarrowLayout, DtARROWS_FLAT_END); n++; XtSetArg(args[n], DtNcolumns, 10); n++; spinBox = DtCreateSpinBox(parent, "spinBox5", args, n); XtManageChild(spinBox);
/* * Free value strings, SpinBox has taken a copy. */ for (i = 0; i < numValueStrings; i++) { XmStringFree(valueXmstrings[i]); } XtFree((char*)valueXmstrings); }
/* * modify/verify callback. * * Allow/disallow alternate user changes */
static void ModifyVerifyCb(Widget w, XtPointer cd, XtPointer cb) { DtSpinBoxCallbackStruct *scb= (DtSpinBoxCallbackStruct*)cb; static Boolean allowChange = True;
scb->doit = allowChange;
if (allowChange == False) { printf("DtSpinBox: DtNmodifyVerifyCallback. Change disallowed.\n"); XBell(XtDisplay(w), 0); }
allowChange = (allowChange == True) ? False : True; }
The DtComboBox widget is a combination of a text field and a list widget that provides a list of valid choices for the text field. Selecting an item from this list automatically fills in the text field with that list item. Figure 7-2 shows examples of a DtComboBox widget.
See the DtComboBox(3X) man page for more information.
Function | Description |
DtCreateComboBox() |
Creates a DtComboBox widget. |
DtComboBoxAddItem() |
Adds an item into a DtComboBox widget at a specified
position. |
DtComboBoxDeletePos() |
Deletes a specified item from a DtComboBox widget. |
DtComboBoxSetItem() |
Selects an item in the XmList of a DtComboBox widget
and makes it the first visible item in the list. |
DtComboBoxSelectItem() |
Selects an item in the XmList of the DtComboBox widget. |
DtComboBox is a subclass of the XmManager class that is used to display XmList or XmScrolledList.
The class pointer is dtComboBoxWidgetClass.
The class name is DtComboBoxWidget.
DtComboBoxWidget does not support subclassing.
The codes in the access column show if you can:
Name | Class | Type | Default | Access |
DtNmarginHeight |
DtCMarginHeight |
Dimension |
2 |
CSG |
DtNmarginWidth |
DtCMarginWidth |
Dimension |
2 |
CSG |
DtNselectedItem |
DtCSelectedItem |
XmString |
Dimension |
CSG |
DtNselectedPosition |
DtCSelectedPosition |
int |
Dimension |
CSG |
DtNselectionCallback |
DtCCallback |
XtCallbackList |
XmString |
C |
DtNcomboBoxType |
DtCComboBoxType |
unsigned char |
int |
CG |
typedef struct {
int reason;
XEvent *event;
XmString item_or_text;
int item_position;
} DtComboBoxCallbackStruct;
Structure | Descriptoin |
reason | The only reason to issue this callback is XmCR_SELECT . |
event | A pointer to the event that caused this callback to be invoked. It
can be NULL . |
item_or_text | The contents of the text widget at the time the event invoked the
callback. This data is only valid within the scope of the
call_data structure, so it must be copied when it is used
outside of this scope. |
item_position | The new value of the DtNposition resource in the
DtComboBox list. If the value is 0, the user
entered a value in the XmTextField widget. |
/* * Example code for DtComboBox */
#include <Dt/ComboBox.h>
static char *comboValueStrings[] = { "alpha", "beta", "gamma", "delta", "epsilon", "zeta", "eta", "theta", "iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega" };
static char *colorStrings[] = { "Red", "Yellow", "Green", "Brown", "Blue" };
static void CreateComboBoxes(Widget parent) { Widget titleLabel, comboBox, list; XmString *valueXmstrings, *colorXmstrings; int numValueStrings, numColorStrings; XmString labelString, xmString; Arg args[20]; int i, n;
/* Create value compound strings */
numValueStrings = XtNumber(comboValueStrings); valueXmstrings = (XmString *)XtMalloc(numValueStrings * sizeof(XmString*)); for (i = 0; i < numValueStrings; i++) { valueXmstrings[i] = XmStringCreateLocalized(comboValueStrings[i]); }
/* Create color compound strings */
numColorStrings = XtNumber(colorStrings); colorXmstrings = (XmString *)XtMalloc(numColorStrings * sizeof(XmString*));
for (i = 0; i < numColorStrings; i++) { colorXmstrings[i] = XmStringCreateLocalized(colorStrings[i]); }
/* Create title label */
labelString = XmStringCreateLocalized("ComboBox Widget"); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; titleLabel = XmCreateLabel(parent, "title", args, n); XtManageChild(titleLabel); XmStringFree(labelString);
/* * Create an editable ComboBox containing the color strings. * Get the widget id of the drop down list, add some greek * letter names to it, and make more items visible. */
n = 0; XtSetArg(args[n], DtNcomboBoxType, DtDROP_DOWN_COMBO_BOX); n++; XtSetArg(args[n], DtNitems, colorXmstrings); n++; XtSetArg(args[n], DtNitemCount, numColorStrings); n++; XtSetArg(args[n], DtNvisibleItemCount, 5); n++; XtSetArg(args[n], DtNcolumns, 10); n++; comboBox = DtCreateComboBox(parent, "comboBox1", args, n); XtManageChild(comboBox);
list = XtNameToWidget(comboBox, "*List"); XmListAddItems(list, valueXmstrings, 10, 0); XtVaSetValues(list, XmNvisibleItemCount, 10, NULL);
/* * Create an editable ComboBox with no entries. * Get the widget id of the drop down list, add some greek * letter names to it and select the third item in the list. */
n = 0; XtSetArg(args[n], DtNcomboBoxType, DtDROP_DOWN_COMBO_BOX); n++; XtSetArg(args[n], DtNorientation, DtLEFT); n++; XtSetArg(args[n], DtNcolumns, 10); n++; comboBox = DtCreateComboBox(parent, "comboBox2", args, n); XtManageChild(comboBox);
list = XtNameToWidget(comboBox, "*List"); XmListAddItems(list, valueXmstrings, 7, 0); XtVaSetValues(list, XmNvisibleItemCount, 7, NULL); XtVaSetValues(comboBox, DtNselectedPosition, 3, NULL);
/* * Create a non-editable ComboBox containing some greek letter names. * Position the arrow on the left. * Select the `gamma' item in the list. */
n = 0; XtSetArg(args[n], DtNorientation, DtLEFT); n++; XtSetArg(args[n], DtNitems, valueXmstrings); n++; XtSetArg(args[n], DtNitemCount, numValueStrings); n++; XtSetArg(args[n], DtNvisibleItemCount, 8); n++; comboBox = DtCreateComboBox(parent, "comboBox3", args, n); XtManageChild(comboBox);
xmString = XmStringCreateLocalized("gamma"); XtVaSetValues(comboBox, DtNselectedItem, xmString, NULL); XmStringFree(xmString);
/* * Create a non-editable ComboBox with no entries. * Position the arrow on the right. * Add the greek letter names to the list and select the fourth item. */
n = 0; XtSetArg(args[n], DtNorientation, DtRIGHT); n++; XtSetArg(args[n], DtNvisibleItemCount, 8); n++; comboBox = DtCreateComboBox(parent, "comboBox4", args, n); XtManageChild(comboBox);
for (i = 0; i < numValueStrings; i++) { DtComboBoxAddItem(comboBox, valueXmstrings[i], 0, True); } XtVaSetValues(comboBox, DtNselectedPosition, 4, NULL);
/* * Free value and color strings, ComboBox has taken a copy. */
for (i = 0; i < numValueStrings; i++) { XmStringFree(valueXmstrings[i]); } XtFree((char*)valueXmstrings);
for (i = 0; i < numColorStrings; i++) { XmStringFree(colorXmstrings[i]); } XtFree((char*)colorXmstrings); }
DtMenuButton widget is a command widget that complements the menu cascading functionality of an XmCascadeButton widget. As a complement to XmCascadeButton widget, it can only be instantiated outside a MenuBar, Pulldown, or Popup (use XmCascadeButton widget inside a MenuPane.) Figure 7-3 shows examples of a DtMenuButton widget.
DtMenuButton widget is a subclass of XmLabel class. Visually, DtMenuButton widget has a label string and a menu glyph. The menu glyph always appears on the right end of the widget and, by default, is a downward pointing arrow.
DtMenuButton widget has an implicitly created submenu attached to it. The submenu is a pop-up menu and has this DtMenuButton widget as its parent. The name of the implicitly created submenu is obtained by prefixing submenu_ to the name of this DtMenuButton widget. You can obtain the widget ID of the submenu by setting an XtGetValues on DtNsubMenuId resource of this DtMenuButton widget. The implicitly created submenu must not be destroyed by the user of this widget.
The submenu can be popped up by pressing the menu post button (see XmNmenuPost resource of XmRowColumn) anywhere on the DtMenuButton widget or by pressing the Motif Cancel key (usually Escape).
The class pointer is dtMenuButtonWidgetClass.
The class name is DtMenuButtonWidget.
DtMenuButtonWidget does not support subclassing.
The codes in the access column show if you can:
Name | Class | Type | Default | Access |
DtNcascadingCallback |
DtCCallback |
XtCallbackList |
NULL |
C |
DtNcascadePixmap |
DtCPixmap |
Pixmap |
XmUNSPECIFIED_PIXMAP |
CSG |
DtNsubMenuID |
DtCMenuWidget |
Widget |
NULL |
SG |
typedef struct {
int reason;
XEvent *event;
} XmAnyCallbackStruct;
Structure | Description |
reason | Returns reason why the callback was invoked. |
event | Points to the XtEvent that triggered the callback or
NULL if the callback was not triggered by an
XtEvent . |
/* * Example code for DtMenuButton */
#include Dt/DtMenuButton.h
/* MenuButton custom glyph */
#define menu_glyph_width 16 #define menu_glyph_height 16 static unsigned char menu_glyph_bits[] = { 0xe0, 0x03, 0x98, 0x0f, 0x84, 0x1f, 0x82, 0x3f, 0x82, 0x3f, 0x81, 0x7f, 0x81, 0x7f, 0xff, 0x7f, 0xff, 0x40, 0xff, 0x40, 0xfe, 0x20, 0xfe, 0x20, 0xfc, 0x10, 0xf8, 0x0c, 0xe0, 0x03, 0x00, 0x00};
static void CreateMenuButtons(Widget parent) { Widget menuButton, submenu, titleLabel, button; Pixmap cascadePixmap; Pixel fg, bg; Cardinal depth; XmString labelString; Arg args[20]; int i, n;
/* Create title label */
labelString = XmStringCreateLocalized("MenuButton Widget"); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; titleLabel = XmCreateLabel(parent, "title", args, n); XtManageChild(titleLabel); XmStringFree(labelString);
/* * Create a MenuButton. * Add push buttons to the built-in popup menu. */
labelString = XmStringCreateLocalized("Action"); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; menuButton = DtCreateMenuButton(parent, "menuButton1", args, n); XtManageChild(menuButton); XmStringFree(labelString);
XtVaGetValues(menuButton, DtNsubMenuId, &submenu, NULL); button = XmCreatePushButton(submenu, "Push", NULL, 0); XtManageChild(button); button = XmCreatePushButton(submenu, "Pull", NULL, 0); XtManageChild(button); button = XmCreatePushButton(submenu, "Turn", NULL, 0); XtManageChild(button);
/* * Create a MenuButton. * Replace the built-in popup menu with a tear-off menu. * Add a custom pixmap in the colors of the MenuButton. */
labelString = XmStringCreateLocalized("Movement"); n = 0; XtSetArg(args[n], XmNlabelString, labelString); n++; menuButton = DtCreateMenuButton(parent, "menuButton1", args, n); XtManageChild(menuButton); XmStringFree(labelString);
/* Create a tear-off menu */
n = 0; XtSetArg(args[0], XmNtearOffModel, XmTEAR_OFF_ENABLED); n++; submenu = XmCreatePopupMenu(menuButton, "submenu", args, n); button = XmCreatePushButton(submenu, "Run", NULL, 0); XtManageChild(button); button = XmCreatePushButton(submenu, "Jump", NULL, 0); XtManageChild(button); button = XmCreatePushButton(submenu, "Stop", NULL, 0); XtManageChild(button);
XtVaSetValues(menuButton, DtNsubMenuId, submenu, NULL);
/* Create a pixmap using the menu button's colors and depth */
XtVaGetValues(menuButton, XmNforeground, &fg, XmNbackground, &bg, XmNdepth, &depth, NULL);
cascadePixmap = XCreatePixmapFromBitmapData(XtDisplay (menuButton),DefaultRootWindow(XtDisplay (menuButton)), (char*)menu_glyph_bits, menu_glyph_width, menu_glyph_height, fg, bg, depth); XtVaSetValues(menuButton, DtNcascadePixmap, cascadePixmap, NULL); }
The Editor Widget library provides support for creating and editing text files. It enables applications running in the desktop environment to have a consistent method of editing text data. The DtEditor(3) widget consists of a scrolled edit window for text, an optional status line, and dialogs for finding and changing text, spell checking, and specifying formatting options. The text editor widget includes a set of convenience functions for programmatically controlling the widget.
DtEditor inherits behavior and resources from Core, Composite, Constraints, XmManager, and XmForm classes.
The class name for the editor widget is DtEditorWidget.
The class pointer is dtEditorWidgetClass.
Function | Description |
DtCreateEditor |
Creates a new instance of a DtEditor widget. |
DtEditorReset |
Restores a DtEditor widget to its intitial state. |
Function | Description |
DtEditorAppend |
Appends content data to the end of an editor widget. |
DtEditorAppendFromFile |
Appends the contents of a file to the end of an editor widget. |
DtEditorGetContents |
Retrieves the entire contents of an editor widget. |
DtEditorInsert |
Inserts content data at the current insertion position. |
DtEditorInsertFromFile |
Inserts the contents of a file at the current insertion position. |
DtEditorReplace |
Replaces a portion of text with the supplied data. |
DtEditorReplaceFromFile |
Replaces a portion of text with the contents of a file. |
DtEditorSaveContentsToFile |
Saves the entire contents to a file. |
DtEditorSetContents |
Loads content data into an editor widget, replacing the entire contents of the widget. |
DtEditorSetContentsFromFile |
Loads the contents of a file into an editor widget, replacing the entire contents of the widget. |
Function | Description |
DtEditorClearSelection |
Replaces the currently selected contents with blanks. |
DtEditorCopyToClipboard |
Copies the currently selected contents to the clipboard. |
DtEditorCutToClipboard |
Removes the currently selected contents, placing them on the clipboard. |
DtEditorDeleteSelection |
Removes the currently selected contents. |
DtEditorDeselect |
Deselects any selected contents. |
DtEditorPasteFromClipboard |
Pastes the contents of the clipboard into an editor widget, replacing any currently selected contents. |
DtEditorSelectAll |
Selects the entire contents of an editor widget. |
Function | Description |
DtEditorFormat |
Formats all or part of the contents of an editor widget. |
DtEditorInvokeFormatDialog |
Displays the format dialog box that enables the user to specify format settings for margins and justification style and to perform formatting operations. |
Function | Description |
DtEditorChange |
Changes one or all occurrences of a string. |
DtEditorFind |
Finds the next occurrence of a string. |
DtEditorInvokeFindChangeDialog |
Displays the dialog box that enables the user to search for, and optionally change, a string. |
DtEditorInvokeSpellDialog |
Displays a dialog box with a list of misspelled words in the current contents. |
Function | Description |
DtEditorCheckForUnsavedChanges |
Reports whether the contents of an editor widget have been altered since the last time they were retrieved or saved. |
DtEditorDisableRedisplay |
Prevents redisplay of an editor widget even though its visual attributes have changed. |
DtEditorEnableRedisplay |
Forces the visual update of an editor widget. |
DtEditorGetInsertPosition |
Returns the insertion cursor position of the editor widget. |
DtEditorGetLastPosition |
Returns the position of the last character in the edit window. |
DtEditorGetMessageTextFieldID |
Retrieves the widget ID of the text field widget used to display application messages. |
DtEditorGetSizeHints |
Retrieves sizing information from an editor widget. |
DtEditorGoToLine |
Moves the insertion cursor to the specified line. |
DtEditorSetInsertionPosition |
Sets the position of the insertion cursor. |
DtEditorTraverseToEditor |
Sets keyboard traversal to the edit window of an editor widget. |
DtEditorUndoEdit |
Undoes the last edit made by a user. |
XGetValues(3X) for DtNtopCharacter returns the position of the first character in the line that is displayed at the top of the widget.
The codes in the access column show if you can:
Name | Class | Type | Default | Access |
DtNautoShowCursorPosition |
DtCAutoShowCursorPosition |
Boolean |
True |
CSG |
DtNblinkRate |
DtCBlinkRate |
int |
500 |
CSG |
DtNbuttonFontList |
DtCFontList |
XmFontList |
Dynamic |
CSG |
DtNcolumns |
DtCColumns |
XmNcolumns |
Dynamic |
CSG |
DtNcursorPosition |
DtCCursorPosition |
XmTextPosition |
0 |
CSG |
DtNcursorPositionVisible |
DtCCursorPositionVisible |
Boolean |
True |
CSG |
DtNdialogTitle |
DtCDialogTitle |
XmString |
NULL |
CSG |
DtNeditable |
DtCEditable |
Boolean |
True |
CSG |
DtNlabelFontList |
DtCFontList |
XmFontList |
Dynamic |
CSG |
DtNmaxLength |
DtCMxLength |
int |
Largest integer |
CSG |
DtNoverstrike |
DtCOverstrike |
Boolean |
False |
CSG |
DtNrows |
DtCRows |
XmNrows |
Dynamic |
CSG |
DtNscrollHorizontal |
DtCScroll |
Boolean |
True |
CG |
DtNscrollLeftSide |
DtCScrollSide |
Boolean |
Dynamic |
CG |
DtNscrollTopSide |
DtCScrollSide |
Boolean |
False |
CG |
DtNscrollVertical |
DtCScroll |
Boolean |
True |
CG |
DtNshowStatusLine |
DtCShowStatusLine |
Boolean |
False |
CSG |
DtNspellFilter |
DtCSpellFilter |
char * |
Spell |
CSG |
DtNtextBackground |
DtCBackground |
Pixel |
Dynamic |
CSG |
DtNtextDeselectCallback |
DtCCallback |
XtCallbackList |
NULL |
C |
DtNtextFontList |
DtCFontList |
XmFontList |
Dynamic |
CSG |
DtNtextForeground |
DtCForeground |
Pixel |
Dynamic |
CSG |
DtNtextTranslations |
DtCTranslations |
XtTranslations |
NULL |
CS |
DtNtextSelectCallback |
DtCCallback |
XtCallbackList |
NULL |
C |
DtNtopCharacter |
DtCTextPosition |
XmTextPosition |
0 |
CSG |
DtNwordWrap |
DtCWordWrap |
Boolean |
True |
CSG |
Name | Class | Type | Default | Access |
DtNcenterToggleLabel |
DtCCenterToggleLabel |
XmString |
Dynamic |
CSG |
DtNchangeAllButtonLabel |
DtCChangeAllButtonLabel |
XmString |
Dynamic |
CSG |
DtNchangeButtonLabel |
DtCChangeButtonLabel |
XmString |
Dynamic |
CSG |
DtNchangeFieldLabel |
DtCChangeFieldLabel |
XmString |
Dynamic |
CSG |
DtNcurrentLineLabel |
DtCCurrentLineLabel |
XmString |
Dynamic |
CSG |
DtNfindButtonLabel |
DtCFindButtonLabel |
XmString |
Dynamic |
CSG |
DtNfindChangeDialogTitle |
DtCFindChangeDialogTitle |
XmString |
Dynamic |
CSG |
DtNfindFieldLabel |
DtCFindFieldLabel |
XmString |
Dynamic |
CSG |
DtNformatAllButtonLabel |
DtCFormatAllButtonLabel |
XmString |
Dynamic |
CSG |
DtNformatParagraphButtonLabel |
DtCFormatParagraphButtonLabel |
XmString |
Dynamic |
CSG |
DtNformatSettingsDialogTitle |
DtCFormatSettingsDialogTitle |
XmString |
Dynamic |
CSG |
DtNinformationDialogTitle |
DtCInformationDialogTitle |
XmString |
Dynamic |
CSG |
DtNjustifyToggleLabel |
DtCJustifyToggleLabel |
XmString |
Dynamic |
CSG |
DtNleftAlignToggleLabel |
DtCLeftAlignToggleLabel |
XmString |
Dynamic |
CSG |
DtNleftMarginFieldLabel |
DtCLeftMarginFieldLabel |
XmString |
Dynamic |
CSG |
DtNmisspelledListLabel |
DtCMisspelledListLabel |
XmString |
Dynamic |
CSG |
DtNoverstrikeLabel |
DtCOverstrikeLabel |
XmString |
Dynamic |
CSG |
DtNrightAlignToggleLabel |
DtCRightAlignToggleLabel |
XmString |
Dynamic |
CSG |
DtNrightMarginFieldLabel |
DtCRightMarginFieldLabel |
XmString |
Dynamic |
CSG |
DtNspellDialogTitle |
DtCSpellDialogTitle |
XmString |
Dynamic |
CSG |
DtNtotalLineCountLabel |
DtCTotalLineCountLabel |
XmString |
Dynamic |
CSG |
typedef struct {
int reason;
XEvent *event;
} DtEditorHelpCallbackStruct;
Structure | Description |
reason | The reason why the callback was invoked. Refer to the
DtEditor(3) man page for a list of reasons. |
event | A pointer to the event that invoked the callback. The value can be
NULL . |
Use the DtNtextSelectCallback and DtNtextDeselectCallback resources when you want to enable and disable menu items and commands depending on whether text is selected. DtNtextSelectCallback specifies a function that is called whenever some text is selected in the edit window. DtNtextDeselectCallback specifies a function that is called whenever no text is selected within the edit window. The reasons sent by the callbacks are DtEDITOR_TEXT_SELECT and DtEDITOR_TEXT_DESELECT.