-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror_msg.c
86 lines (65 loc) · 2.44 KB
/
error_msg.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "main.h"
void ErrorMsgHelp_Close(Widget w,
Widget PopupWidget,
XmAnyCallbackStruct *call_value)
{
XtPopdown(PopupWidget);
}
void ErrorMessage(char *ErrorMessageString)
{
Widget ErrorMessage_Dialog;
XmString ErrorMessageXmString;
XmString OkXmString;
ErrorMessageXmString = XmStringLtoRCreate(ErrorMessageString, XmFONTLIST_DEFAULT_TAG);
OkXmString = XmStringCreate("Close",XmFONTLIST_DEFAULT_TAG);
ErrorMessage_Dialog = XmCreateErrorDialog(W_TopLevel,
"ErrorMessage",
NULL,0);
XtVaSetValues(ErrorMessage_Dialog,
XmNmessageString, ErrorMessageXmString,
XmNokLabelString, OkXmString,
NULL,0);
XtVaSetValues(XtParent(ErrorMessage_Dialog),
XmNtitle, "Error Message",
NULL,0);
XmStringFree(ErrorMessageXmString);
XmStringFree(OkXmString);
XtUnmanageChild((Widget )XmMessageBoxGetChild(ErrorMessage_Dialog, XmDIALOG_HELP_BUTTON));
XtUnmanageChild((Widget )XmMessageBoxGetChild(ErrorMessage_Dialog, XmDIALOG_CANCEL_BUTTON));
XtManageChild(ErrorMessage_Dialog);
XWarpPointer(XtDisplay(ErrorMessage_Dialog),None,XtWindow(ErrorMessage_Dialog),0,0,0,0,1,1);
XBell(XtDisplay(W_TopLevel),100);
XtPopup(XtParent(ErrorMessage_Dialog), XtGrabNone);
}
void InfoMsgHelp_Close(Widget w,
Widget PopupWidget,
XmAnyCallbackStruct *call_value)
{
XtPopdown(PopupWidget);
}
void InfoMessage(char *InfoMessageString)
{
Widget InfoMessage_Dialog;
XmString InfoMessageXmString;
XmString OkXmString;
InfoMessageXmString = XmStringLtoRCreate(InfoMessageString, XmFONTLIST_DEFAULT_TAG);
OkXmString = XmStringCreate("Close",XmFONTLIST_DEFAULT_TAG);
InfoMessage_Dialog = XmCreateInformationDialog(W_TopLevel,
"InfoMessage",
NULL,0);
XtVaSetValues(InfoMessage_Dialog,
XmNmessageString, InfoMessageXmString,
XmNokLabelString, OkXmString,
NULL,0);
XtVaSetValues(XtParent(InfoMessage_Dialog),
XmNtitle, "Information Message",
NULL,0);
XmStringFree(InfoMessageXmString);
XmStringFree(OkXmString);
XtUnmanageChild((Widget )XmMessageBoxGetChild(InfoMessage_Dialog, XmDIALOG_HELP_BUTTON));
XtUnmanageChild((Widget )XmMessageBoxGetChild(InfoMessage_Dialog, XmDIALOG_CANCEL_BUTTON));
XtManageChild(InfoMessage_Dialog);
XWarpPointer(XtDisplay(InfoMessage_Dialog),None,XtWindow(InfoMessage_Dialog),0,0,0,0,1,1);
XBell(XtDisplay(W_TopLevel),100);
XtPopup(XtParent(InfoMessage_Dialog), XtGrabNone);
}