include sys/select.h before ex/extern.h
[nvi.git] / motif_l / m_prompt.c
blobe4f01f1b6a40cf33c0b76238e4012e7aa5960d25
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.8 2003/11/05 17:10:00 skimo Exp $ (Berkeley) $Date: 2003/11/05 17:10:00 $";
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 #undef LOCK_SUCCESS
29 #include "../common/common.h"
30 #include "../ipc/ip.h"
31 #include "m_motif.h"
34 void vi_fatal_message(Widget parent, String str)
36 Widget db = XmCreateErrorDialog( parent, "Fatal", NULL, 0 );
37 XmString msg = XmStringCreateSimple( str );
39 XtVaSetValues( XtParent(db),
40 XmNtitle, "Fatal",
43 XtVaSetValues( db,
44 XmNmessageString, msg,
47 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
49 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
50 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
52 __vi_modal_dialog( db );
54 exit(0);
58 void vi_info_message(Widget parent, String str)
60 static Widget db = NULL;
61 XmString msg = XmStringCreateSimple( str );
63 if ( db == NULL )
64 db = XmCreateInformationDialog( parent, "Information", NULL, 0 );
66 XtVaSetValues( XtParent(db),
67 XmNtitle, "Information",
70 XtVaSetValues( db,
71 XmNmessageString, msg,
74 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
76 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
77 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
79 __vi_modal_dialog( db );