2
0

ErrorDialog.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. }
  44. /******************************************************************************/
  45. /* display_error_message - display desired message in error dialog */
  46. /* INPUT: char *message - message to display in dialog box */
  47. /* OUTPIT: none */
  48. /******************************************************************************/
  49. void display_error_message (Widget parent, char *message)
  50. {
  51. ErrorDialog = XmCreateErrorDialog(parent, "errorDialog", NULL, 0);
  52. XtUnmanageChild (XmMessageBoxGetChild (ErrorDialog, XmDIALOG_CANCEL_BUTTON));
  53. XtUnmanageChild (XmMessageBoxGetChild (ErrorDialog, XmDIALOG_HELP_BUTTON));
  54. XtAddCallback( ErrorDialog, XmNokCallback,
  55. (XtCallbackProc) activateCB_ErrorDialog_OkButton,
  56. (XtPointer) NULL );
  57. XtVaSetValues (ErrorDialog,
  58. RES_CONVERT(XmNdialogTitle, GETMESSAGE(6, 31, "Create Action - Error")),
  59. RES_CONVERT(XmNmessageString, message),
  60. NULL);
  61. XtManageChild (ErrorDialog);
  62. return;
  63. }
  64. /*******************************************************************************
  65. END OF FILE
  66. *******************************************************************************/