In CDE, such messages are directed to log files that a casual user may not routinely examine. Use the following rules when deciding where to tell users about warnings, messages, and error conditions:
For more information on writing messages, see the CDE Internationalization Programmer's Guide.
Adding online help for a dialog is a straightforward task. Once you have decided that a particular dialog is a candidate for online help, do the following:
This ID provides the link to the online help text. IDs should be 64 characters or less; for example, DiskSpaceError.
Use the XmCreateErrorDialog convenience function for error messages and XmCreateWarningDialog for warnings, adding the help callback as follows:
XtAddCallback(dialog, XmNhelpCallback, helpfn, "ID");
In this example, helpfn is a help function you have created to manage the help dialog, and the string "ID" is
the ID you chose for the error message (for example, DiskSpaceError). In your help function, set the
XmNlocationId resource to the value of ID. The /usr/dt/examples/dthelp directory contains examples of
how to set up such a help function.For detailed information about creating and managing help dialog widgets, see the CDE Help System Author's and Programmer's Guide.
Document the message in the "messages" chapter of your help volume. In the help source document, you should have a separate section for each message, and the ID= attribute at the beginning of the section should match the ID you chose in your code for the error.
For example, in the s1 section heading, the ID is DiskSpaceError
.
When the user's system has insufficient disk space, the error message the user sees from the following heading is "Could Not Save File."
<s1 ID=DiskSpaceError>Could Not Save File <\s1>
Note that by convention, the text of the section heading should correspond closely to the text in the error dialog.
The new help section for the error message becomes active as soon as you rebuild the help file (using the dthelptag program) and recompile your application.