The DtEditor widget supports three callback functions:
DtEditorNHelpCallback
DtNtextSelectCallback
DtNtextDeselectCallback
If you want to present help information about the editor widget and its dialog boxes, set the XmNhelpCallback resource and use the reason field passed as part of DtEditorHelpCallbackStruct to set the contents of the Help dialog box. A pointer to the following structure is passed to XmNHelpCallback. The callback structure and is described in Table 7-11 .
typedef struct { int reason; XEvent *event; } DtEditorHelpCallbackStruct;Table 7-11 DtEditorHelp Callback Structure
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 this 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.