home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / m / master12.zip / mastering / Newapp / ExitDialog.c < prev    next >
C/C++ Source or Header  |  1992-08-19  |  1KB  |  47 lines

  1. /* ExitDialog.c -- This file contains CreateExitDialog(), a convenienc
  2.                    function for creating newapp's Exit dialog.  */
  3.  
  4. #include "Global.h"
  5. #include "Dialog.h"
  6.  
  7. /******************************************************************************
  8.                 C r e a t e   E x i t   D i a l o g
  9. ******************************************************************************/
  10.  
  11. Widget  CreateExitDialog(parent)
  12.      Widget parent;
  13. {
  14.  
  15.   Widget    dialog;
  16.   XmString  title, message;
  17.  
  18.   /* Create the XmStrings needed for creating the dialog. */
  19.   title = XmStringCreateSimple ("New Application - Exit");
  20.   message = XmStringCreateSimple ("Exit New Application?");
  21.  
  22.   /* Create the dialog widget. */
  23.   ac = 0;
  24.   XtSetArg(al[ac], XmNdialogTitle, title);  ac++;
  25.   XtSetArg(al[ac], XmNmessageString, message);  ac++;
  26.   XtSetArg(al[ac], XmNtransient, True);  ac++;
  27.   XtSetArg(al[ac], XmNdialogStyle, XmDIALOG_FULL_APPLICATION_MODAL);  ac++;
  28.   XtSetArg(al[ac], XmNnoResize, True);  ac++;
  29.   dialog = XmCreateQuestionDialog (parent, "exitDialog", al, ac);
  30.  
  31.   /* Remove the Help button (since there is no help available). */
  32.   XtUnmanageChild (XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
  33.  
  34.   /* Add the callback for the OK button. */
  35.   XtAddCallback (dialog, XmNokCallback, DialogCB, DIALOG_Exit_OK);
  36.  
  37.   /* Free the memory used to create the original XmStrings. */
  38.   XmStringFree (title);
  39.   XmStringFree (message);
  40.  
  41.   /* Return the widget ID of the dialog. */
  42.   return (dialog);
  43.  
  44. }
  45.  
  46.  
  47.