Add preliminary db1.c from Aymeric Vincent <xmimic@free.fr>
[nvi.git] / motif_l / m_prompt.c
blob4812f92c58ef334983d3087c69db5a66143f1ae3
1 /*-
2 * Copyright (c) 1996
3 * Rob Zimmermann. All rights reserved.
4 * Copyright (c) 1996
5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
8 */
10 #include "config.h"
12 #ifndef lint
13 static const char sccsid[] = "$Id: m_prompt.c,v 8.7 2001/06/25 15:19:27 skimo Exp $ (Berkeley) $Date: 2001/06/25 15:19:27 $";
14 #endif /* not lint */
16 #include <sys/types.h>
17 #include <sys/queue.h>
19 #include <X11/X.h>
20 #include <X11/Intrinsic.h>
21 #include <Xm/MessageB.h>
23 #include <bitstring.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
28 #include "../common/common.h"
29 #include "../ipc/ip.h"
30 #include "m_motif.h"
33 void vi_fatal_message(Widget parent, String str)
35 Widget db = XmCreateErrorDialog( parent, "Fatal", NULL, 0 );
36 XmString msg = XmStringCreateSimple( str );
38 XtVaSetValues( XtParent(db),
39 XmNtitle, "Fatal",
42 XtVaSetValues( db,
43 XmNmessageString, msg,
46 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
48 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
49 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
51 __vi_modal_dialog( db );
53 exit(0);
57 void vi_info_message(Widget parent, String str)
59 static Widget db = NULL;
60 XmString msg = XmStringCreateSimple( str );
62 if ( db == NULL )
63 db = XmCreateInformationDialog( parent, "Information", NULL, 0 );
65 XtVaSetValues( XtParent(db),
66 XmNtitle, "Information",
69 XtVaSetValues( db,
70 XmNmessageString, msg,
73 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
75 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
76 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
78 __vi_modal_dialog( db );