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