ErrorDialog.c 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 libraries 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. ErrorDialog.c
  26. Associated Header file: ErrorDialog.h
  27. *******************************************************************************/
  28. #include <stdio.h>
  29. #include <Xm/Xm.h>
  30. #include "UxXt.h"
  31. #include "dtcreate.h"
  32. #define CONTEXT_MACRO_ACCESS 1
  33. #include "ErrorDialog.h"
  34. #undef CONTEXT_MACRO_ACCESS
  35. /******************************************************************************/
  36. /* activateCB_ErrorDialog_OkButton */
  37. /******************************************************************************/
  38. void activateCB_ErrorDialog_OkButton( Widget UxWidget,
  39. XtPointer UxClientData,
  40. XtPointer UxCallbackArg)
  41. {
  42. XtDestroyWidget(XtParent(UxWidget));
  43. *(Widget **)UxClientData = NULL;
  44. }
  45. /******************************************************************************/
  46. /* display_error_message - display desired message in error dialog */
  47. /* INPUT: char *message - message to display in dialog box */
  48. /* OUTPIT: none */
  49. /******************************************************************************/
  50. void display_error_message (Widget parent, char *message)
  51. {
  52. ErrorDialog = XmCreateErrorDialog(parent, "errorDialog", NULL, 0);
  53. XtUnmanageChild (XmMessageBoxGetChild (ErrorDialog, XmDIALOG_CANCEL_BUTTON));
  54. XtUnmanageChild (XmMessageBoxGetChild (ErrorDialog, XmDIALOG_HELP_BUTTON));
  55. XtAddCallback( ErrorDialog, XmNokCallback,
  56. (XtCallbackProc) activateCB_ErrorDialog_OkButton,
  57. (XtPointer) &ErrorDialog );
  58. XtVaSetValues (ErrorDialog,
  59. RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 31, "Create Action - Error")),
  60. RES_CONVERT(XmNmessageString, message),
  61. NULL);
  62. XtManageChild (ErrorDialog);
  63. return;
  64. }
  65. /*******************************************************************************
  66. END OF FILE
  67. *******************************************************************************/