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