m_prompt.c revision 1.1.1.1 1 /*-
2 * Copyright (c) 1996
3 * Rob Zimmermann. All rights reserved.
4 * Copyright (c) 1996
5 * Keith Bostic. All rights reserved.
6 *
7 * See the LICENSE file for redistribution information.
8 */
9
10 #include "config.h"
11
12 #ifndef lint
13 static const char sccsid[] = "Id: m_prompt.c,v 8.8 2003/11/05 17:10:00 skimo Exp (Berkeley) Date: 2003/11/05 17:10:00 ";
14 #endif /* not lint */
15
16 #include <sys/types.h>
17 #include <sys/queue.h>
18
19 #include <X11/X.h>
20 #include <X11/Intrinsic.h>
21 #include <Xm/MessageB.h>
22
23 #include <bitstring.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27
28 #undef LOCK_SUCCESS
29 #include "../common/common.h"
30 #include "../ipc/ip.h"
31 #include "m_motif.h"
32
33
34 void vi_fatal_message(Widget parent, String str)
36 {
37 Widget db = XmCreateErrorDialog( parent, "Fatal", NULL, 0 );
38 XmString msg = XmStringCreateSimple( str );
39
40 XtVaSetValues( XtParent(db),
41 XmNtitle, "Fatal",
42 0
43 );
44 XtVaSetValues( db,
45 XmNmessageString, msg,
46 0
47 );
48 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
49
50 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
51 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
52
53 __vi_modal_dialog( db );
54
55 exit(0);
56 }
57
58
59 void vi_info_message(Widget parent, String str)
61 {
62 static Widget db = NULL;
63 XmString msg = XmStringCreateSimple( str );
64
65 if ( db == NULL )
66 db = XmCreateInformationDialog( parent, "Information", NULL, 0 );
67
68 XtVaSetValues( XtParent(db),
69 XmNtitle, "Information",
70 0
71 );
72 XtVaSetValues( db,
73 XmNmessageString, msg,
74 0
75 );
76 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
77
78 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
79 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
80
81 __vi_modal_dialog( db );
82 }
83