Common Desktop Environment: Desktop KornShell User's Guide

Built-in Xt Intrinsic Commands

All the Xt Intrinsics commands used to create a new widget require that you specify a widget class for the new widget. The widget (or gadget) class name is the standard class name provided by Motif. For example, the class name for a Motif push button widget is XmPushButton, while the class name for the Motif label gadget is XmLabelGadget.

XtAddCallback widgetHandle callbackName ksh-command

where callbackName is one of the standard Motif or Xt callback names, with the Xt or Xm prefix dropped. For example, activateCallback.

XtAddEventHandler widgetHandle eventMask nonMaskableFlag ksh-command

where eventMask is of the form mask|mask|mask and the mask components are any of the standard set of X event masks, and nonMaskableFlag is either true or false.

XtAddInput variable [-r] fileDescriptor ksh-command

Registers the indicated file descriptor with the X Toolkit as an alternate input source. It is the responsibility of the shell script's input handler to unregister the input source when it is no longer needed and to close the file descriptor.

If the -r option is specified (raw mode), then dtksh does not automatically read any of the data available from the input source; it will be up to the specified kshell command to read all data. If the -r option is not specified, then the command specified in ksh-command is invoked only when a full line is read (that is, a line terminated by either an unescaped newline character or the end of the file) or when the end of the file is reached. The raw mode is useful for handlers that expect to process nontextual data, or for handlers that do not want dtksh automatically reading in a line of data. When the end of file is detected, it is the shell script's input handler's responsibility to use XtRemoveInput to remove the input source and to close the file descriptor, if necessary.

In all cases, several environment variables are set up, which can be used by the handler. These include:

INPUT_LINE

Empty if in raw mode; otherwise, it contains the next line to be processed.

INPUT_EOF

Set to true if end-of-file is reached; otherwise, set to false.

INPUT_SOURCE

File descriptor associated with this input source.

INPUT_ID

The ID associated with this input handler; returned by XtAddInput().

XtAddTimeout variable interval ksh-command

XtAddWorkProc variable ksh-command

In dtksh, the kshell command is typically a kshell function name. Like regular work procedures, this function is expected to return a value that indicates whether the work procedure wants to be called again, or whether it has completed its work and can be automatically unregistered. If the dtksh function returns 0, then the work procedure remains registered; any other value causes the work procedure to be automatically unregistered.

XtAugmentTranslations widgetHandle translations

XtCreateApplicationShell variable applicationName widgetClass [resource:value ...]
XtCallCallbacks widgetHandle callbackName

where callbackName is one of the standard Motif or Xt callback names, with the Xt or Xm prefix dropped; for example, activateCallback.

XtClass variable widgetHandle

Returns the name of the widget class associated with the passed-in widget handle.

XtCreateManagedWidget variable widgetName widgetClass  
parentWidgetHandle [resource:value ...]
XtCreatePopupShell variable widgetName widgetClass
 parentWidgetHandle [resource:value ...]
XtCreateWidget variable widgetName widgetClass 
parentWidgetHandle [resource:value ...]
XtDestroyWidget widgetHandle [widgetHandle ...]

XtDisplay variable widgetHandle

XtDisplayOfObject variable widgetHandle

XtGetValues widgetHandle resource: var1 [resource: var2 ...]

XtHasCallbacks variable widgetHandle callbackName

where callbackName is one of the standard Motif or Xt callback names, with the Xt or Xm prefix dropped; for example, activateCallback.

variable is set to one of the strings CallbackNoList, CallbackHasNone, or CallbackHasSome.

XtInitialize variable shellName applicationClassName applicationName [arguments]

Using Dtksh as the applicationClassName causes the application to use the default dtksh app-defaults file. The arguments parameter is used to reference any command-line arguments that might have been specified by the user of the shell script; these are typically referred to using the shell syntax of "$@".

Returns a value which can be used in a conditional statement.

XtIsManaged widgetHandle

Returns a value which can be used in a conditional statement.

XtIsSubclass widgetHandle widgetClass

where widgetClass is the name of a widget class. Returns a value which can be used in a conditional statement.

XtNameToWidget variable referenceWidget name

XtIsRealized widgetHandle

Returns a value which can be used in a conditional statement.

XtIsSensitive widgetHandle

Returns a value which can be used in a conditional statement.

XtIsShell widgetHandle

Returns a value which can be used in a conditional statement.

XtLastTimestampProcessed variable display

XtMainLoop

XtManageChild widgetHandle

XtManageChildren widgetHandle [widgetHandle ...]

XtMapWidget widgetHandle

XtOverrideTranslations widgetHandle translations

XtParent variable widgetHandle

XtPopdown widgetHandle

XtPopup widgetHandle grabType

where grabType is one of the strings GrabNone, GrabNonexclusive or GrabExclusive.

XtRealizeWidget widgetHandle

XtRemoveAllCallbacks widgetHandle callbackName

where callbackName is one of the standard Motif or Xt callback names, with the Xt or Xm prefix dropped; for example, activateCallback

XtRemoveCallback widgetHandle callbackName ksh-command

where callbackName is one of the standard Motif or Xt callback names, with the Xt or Xm prefix dropped; for example, activateCallback. As is true with traditional Xt callbacks, when a callback is removed, the same kshell command string must be specified as was specified when the callback was originally registered.

XtRemoveEventHandler widgetHandle eventMasknonMaskableFlag ksh-command

where eventMask is of the form mask|mask|mask and the mask components are any of the standard set of X event masks; that is. ButtonPressMask where nonMaskableFlag is either true or false.

As is true with traditional Xt event handlers, when an event handler is removed, the same eventMask, nonMaskableFlag setting, and kshell command string must be specified as was specified when the event handler was originally registered.

XtRemoveInput inputId

where inputId is the handle that was returned in the specified environment variable when the alternate input source was registered using the XtAddInput command.

XtRemoveTimeOut timeoutId

where timeoutId is the handle that was returned in the specified environment variable when the timeout was registered using the XtAddTimeOut command.

XtRemoveWorkProc workprocID

where workprocID is the handle that was returned in the specified environment variable when the work procedure was registered using the XtAddWorkProc command.

XtScreen variable widgetHandle

XtSetSensitive widgetHandle state

where state is either true or false.

XtSetValues widgetHandle resource:value [resource: value ...]

XtUninstallTranslations widgetHandle

XtUnmanageChild widgetHandle

XtUnmanageChildren widgetHandle [widgetHandle ...]

XtUnmapWidget widgetHandle

XtUnrealizeWidget widgetHandle

XtWindow variable widgetHandle