Sync usage with man page.
[netbsd-mini2440.git] / dist / nvi / motif_l / m_prompt.c
blob6cd3f67501e8361bc4bd8ed967e12a7e309934ca
1 /* $NetBSD$ */
3 /*-
4 * Copyright (c) 1996
5 * Rob Zimmermann. All rights reserved.
6 * Copyright (c) 1996
7 * Keith Bostic. All rights reserved.
9 * See the LICENSE file for redistribution information.
12 #include "config.h"
14 #ifndef lint
15 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";
16 #endif /* not lint */
18 #include <sys/types.h>
19 #include <sys/queue.h>
21 #include <X11/X.h>
22 #include <X11/Intrinsic.h>
23 #include <Xm/MessageB.h>
25 #include <bitstring.h>
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
30 #undef LOCK_SUCCESS
31 #include "../common/common.h"
32 #include "../ipc/ip.h"
33 #include "m_motif.h"
36 void vi_fatal_message(Widget parent, String str)
38 Widget db = XmCreateErrorDialog( parent, "Fatal", NULL, 0 );
39 XmString msg = XmStringCreateSimple( str );
41 XtVaSetValues( XtParent(db),
42 XmNtitle, "Fatal",
45 XtVaSetValues( db,
46 XmNmessageString, msg,
49 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
51 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
52 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
54 __vi_modal_dialog( db );
56 exit(0);
60 void vi_info_message(Widget parent, String str)
62 static Widget db = NULL;
63 XmString msg = XmStringCreateSimple( str );
65 if ( db == NULL )
66 db = XmCreateInformationDialog( parent, "Information", NULL, 0 );
68 XtVaSetValues( XtParent(db),
69 XmNtitle, "Information",
72 XtVaSetValues( db,
73 XmNmessageString, msg,
76 XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
78 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
79 XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
81 __vi_modal_dialog( db );