Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtcreate / ErrorDialog.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: ErrorDialog.c /main/5 1996/10/15 14:46:17 rswiston $ */
24
25 /*******************************************************************************
26         ErrorDialog.c
27
28        Associated Header file: ErrorDialog.h
29 *******************************************************************************/
30
31 #include <stdio.h>
32
33 #include <Xm/Xm.h>
34 #include "UxXt.h"
35 #include "dtcreate.h"
36
37 #define CONTEXT_MACRO_ACCESS 1
38 #include "ErrorDialog.h"
39 #undef CONTEXT_MACRO_ACCESS
40
41 /******************************************************************************/
42 /* activateCB_ErrorDialog_OkButton                                            */
43 /******************************************************************************/
44 void    activateCB_ErrorDialog_OkButton( Widget  UxWidget,
45                                         XtPointer UxClientData,
46                                         XtPointer UxCallbackArg)
47
48 {
49   XtDestroyWidget(XtParent(UxWidget));
50 }
51
52 /******************************************************************************/
53 /* display_error_message - display desired message in error dialog            */
54 /* INPUT:  char *message - message to display in dialog box                   */
55 /* OUTPIT: none                                                               */
56 /******************************************************************************/
57 void display_error_message (Widget parent, char *message)
58 {
59
60   ErrorDialog = XmCreateErrorDialog(parent, "errorDialog", NULL, 0);
61   XtUnmanageChild (XmMessageBoxGetChild (ErrorDialog, XmDIALOG_CANCEL_BUTTON));
62   XtUnmanageChild (XmMessageBoxGetChild (ErrorDialog, XmDIALOG_HELP_BUTTON));
63
64   XtAddCallback( ErrorDialog, XmNokCallback,
65           (XtCallbackProc) activateCB_ErrorDialog_OkButton,
66           (XtPointer) NULL );
67
68   XtVaSetValues (ErrorDialog,
69                  RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 31, "Create Action - Error")),
70                  RES_CONVERT(XmNmessageString, message),
71                  NULL);
72
73   XtManageChild (ErrorDialog);
74   return;
75 }
76 /*******************************************************************************
77        END OF FILE
78 *******************************************************************************/
79