Home | History | Annotate | Line # | Download | only in motif_l
      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 #include <sys/cdefs.h>
     13 #if 0
     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 */
     17 #else
     18 __RCSID("$NetBSD: m_prompt.c,v 1.2 2014/01/26 21:43:45 christos Exp $");
     19 #endif
     20 
     21 #include <sys/types.h>
     22 #include <sys/queue.h>
     23 
     24 #include <X11/X.h>
     25 #include <X11/Intrinsic.h>
     26 #include <Xm/MessageB.h>
     27 
     28 #include <bitstring.h>
     29 #include <stdio.h>
     30 #include <stdlib.h>
     31 #include <string.h>
     32 
     33 #undef LOCK_SUCCESS
     34 #include "../common/common.h"
     35 #include "../ipc/ip.h"
     36 #include "m_motif.h"
     37 
     38 
     39 void	vi_fatal_message(Widget parent, String str)
     41 {
     42     Widget	db = XmCreateErrorDialog( parent, "Fatal", NULL, 0 );
     43     XmString	msg = XmStringCreateSimple( str );
     44 
     45     XtVaSetValues( XtParent(db),
     46 		   XmNtitle,		"Fatal",
     47 		   0
     48 		   );
     49     XtVaSetValues( db,
     50 		   XmNmessageString,	msg,
     51 		   0
     52 		   );
     53     XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
     54 
     55     XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
     56     XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
     57 
     58     __vi_modal_dialog( db );
     59 
     60     exit(0);
     61 }
     62 
     63 
     64 void	vi_info_message(Widget parent, String str)
     66 {
     67     static	Widget	db = NULL;
     68     XmString	msg = XmStringCreateSimple( str );
     69 
     70     if ( db == NULL )
     71 	db = XmCreateInformationDialog( parent, "Information", NULL, 0 );
     72 
     73     XtVaSetValues( XtParent(db),
     74 		   XmNtitle,		"Information",
     75 		   0
     76 		   );
     77     XtVaSetValues( db,
     78 		   XmNmessageString,	msg,
     79 		   0
     80 		   );
     81     XtAddCallback( XtParent(db), XmNpopdownCallback, __vi_cancel_cb, 0 );
     82 
     83     XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_CANCEL_BUTTON ) );
     84     XtUnmanageChild( XmMessageBoxGetChild( db, XmDIALOG_HELP_BUTTON ) );
     85 
     86     __vi_modal_dialog( db );
     87 }
     88