dthelp: Change to ANSI function definitions
[oweals/cde.git] / cde / programs / dtfile / dtfile_error.cpp
1 XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
2 XCOMM $XConsortium: dtfile_error.cpp /main/3 1996/04/21 19:29:14 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 1996 Digital Equipment Corporation.
13 XCOMM (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
14 XCOMM (c) Copyright 1993,1994,1996 International Business Machines Corp.
15 XCOMM (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
16 XCOMM (c) Copyright 1996 Novell, Inc. 
17 XCOMM (c) Copyright 1996 FUJITSU LIMITED.
18 XCOMM (c) Copyright 1996 Hitachi.
19 XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
20 XCOMM     Novell, Inc.
21 XCOMM ###################################################################
22
23 XCOMM --------------------
24 XCOMM  OK button callback
25 XCOMM --------------------
26
27 okCallback()
28 {
29    exit
30 }
31
32
33 XCOMM ------
34 XCOMM  main
35 XCOMM ------
36
37 MESSAGE="$@"
38 #ifdef _AIX
39 MSGCAT=/usr/dt/lib/nls/msg/$LANG/dtfile.cat
40 TITLE=`dspmsg $MSGCAT -s 32 1 "dt Error"`
41 #else
42 TITLE="dt Error"
43 #endif /* _AIX */
44
45 XtInitialize TOP dtError DtError "$@"
46
47 XmCreateErrorDialog DIALOG \
48                     $TOP \
49                     "Test" \
50                     dialogTitle:"$TITLE" \
51                     messageString:"$MESSAGE"
52
53 XCOMM remove cancel and help buttons
54 XmMessageBoxGetChild CANCEL $DIALOG DIALOG_CANCEL_BUTTON
55 XmMessageBoxGetChild HELP   $DIALOG DIALOG_HELP_BUTTON
56 XtUnmanageChild $CANCEL
57 XtUnmanageChild $HELP
58
59 XtAddCallback $DIALOG okCallback "okCallback"
60
61 XtManageChild $DIALOG
62
63 XtMainLoop