Merge branch 'master' into cde-next
[oweals/cde.git] / cde / programs / dtfile / dterror.src
1 XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
2 XCOMM $XConsortium: dterror.src /main/4 1996/11/19 11:40:20 drk $
3 XCOMM ####################################################################
4 XCOMM   Display an error dialog using the argument(s) as the message
5 XCOMM 
6 XCOMM   This script can be used by applications to display an error
7 XCOMM   dialog when it would be difficult or impossible to do in the
8 XCOMM   context of the executing program. For example, it can be used
9 XCOMM   when exec fails in a child process or if an error is detected
10 XCOMM   before an applications main window can be realized.
11 XCOMM 
12 XCOMM   (c) Copyright 1993, 1994 Hewlett-Packard Company
13 XCOMM   (c) Copyright 1993, 1994 International Business Machines Corp.
14 XCOMM   (c) Copyright 1993, 1994 Sun Microsystems, Inc.
15 XCOMM   (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
16 XCOMM       Novell, Inc.
17 XCOMM #####################################################################
18
19 XCOMM --------------------
20 XCOMM  OK button callback
21 XCOMM --------------------
22
23 okCallback()
24 {
25    exit
26 }
27
28
29 XCOMM ------
30 XCOMM  main
31 XCOMM ------
32
33 MESSAGE="$@"
34 #ifdef _AIX
35 MSGCAT=/usr/dt/lib/nls/msg/$LANG/dtfile.cat
36 TITLE=`dspmsg $MSGCAT -s 32 1 "dt Error"`
37 #else
38 TITLE="dt Error"
39 #endif /* _AIX */
40
41 XtInitialize TOP dtError DtError "$@"
42
43 XmCreateErrorDialog DIALOG \
44                     $TOP \
45                     "Test" \
46                     dialogTitle:"$TITLE" \
47                     messageString:"$MESSAGE"
48
49 XCOMM  remove cancel and help buttons
50 XmMessageBoxGetChild CANCEL $DIALOG DIALOG_CANCEL_BUTTON
51 XmMessageBoxGetChild HELP   $DIALOG DIALOG_HELP_BUTTON
52 XtUnmanageChild $CANCEL
53 XtUnmanageChild $HELP
54
55 XtAddCallback $DIALOG okCallback "okCallback"
56
57 XtManageChild $DIALOG
58
59 XtMainLoop