OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [tix/] [unix/] [tk8.0/] [tixAppInit.c] - Blame information for rev 1778

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/*
2
 * tixAppInit.c --
3
 *
4
 *      Provides a default version of the Tcl_AppInit procedure for
5
 *      use in wish and similar Tk-based applications.
6
 *
7
 * Copyright (c) 1995 Ioi K Lam
8
 * Copyright (c) 1993 The Regents of the University of California.
9
 * Copyright (c) 1994 Sun Microsystems, Inc.
10
 *
11
 * See the file "license.terms" for information on usage and redistribution
12
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13
 */
14
 
15
#include <tk.h>
16
#include <tix.h>
17
 
18
/*
19
 * The following variable is a special hack that is needed in order for
20
 * Sun shared libraries to be used for Tcl.
21
 */
22
 
23
extern int matherr();
24
int *tclDummyMathPtr = (int *) matherr;
25
 
26
/*
27
 *----------------------------------------------------------------------
28
 *
29
 * main --
30
 *
31
 *      This is the main program for the application.
32
 *
33
 * Results:
34
 *      None: Tk_Main never returns here, so this procedure never
35
 *      returns either.
36
 *
37
 * Side effects:
38
 *      Whatever the application does.
39
 *
40
 *----------------------------------------------------------------------
41
 */
42
 
43
int
44
main(argc, argv)
45
    int argc;                   /* Number of command-line arguments. */
46
    char **argv;                /* Values of command-line arguments. */
47
{
48
    Tk_Main(argc, argv, Tcl_AppInit);
49
    return 0;                    /* Needed only to prevent compiler warning. */
50
}
51
 
52
/*
53
 *----------------------------------------------------------------------
54
 *
55
 * Tcl_AppInit --
56
 *
57
 *      This procedure performs application-specific initialization.
58
 *      Most applications, especially those that incorporate additional
59
 *      packages, will have their own version of this procedure.
60
 *
61
 * Results:
62
 *      Returns a standard Tcl completion code, and leaves an error
63
 *      message in interp->result if an error occurs.
64
 *
65
 * Side effects:
66
 *      Depends on the startup script.
67
 *
68
 *----------------------------------------------------------------------
69
 */
70
 
71
int
72
Tcl_AppInit(interp)
73
    Tcl_Interp *interp;         /* Interpreter for application. */
74
{
75
    if (Tcl_Init(interp) == TCL_ERROR) {
76
        return TCL_ERROR;
77
    }
78
    if (Tk_Init(interp) == TCL_ERROR) {
79
        return TCL_ERROR;
80
    }
81
    Tcl_StaticPackage(interp, "Tk",  Tk_Init,  (Tcl_PackageInitProc *) NULL);
82
    if (Tix_Init(interp) == TCL_ERROR) {
83
        return TCL_ERROR;
84
    }
85
    Tcl_StaticPackage(interp, "Tix", Tix_Init, (Tcl_PackageInitProc *) NULL);
86
 
87
    /*
88
     * Call the init procedures for included packages.  Each call should
89
     * look like this:
90
     *
91
     * if (Mod_Init(interp) == TCL_ERROR) {
92
     *     return TCL_ERROR;
93
     * }
94
     *
95
     * where "Mod" is the name of the module.
96
     */
97
 
98
    /*
99
     * Call Tcl_CreateCommand for application-specific commands, if
100
     * they weren't already created by the init procedures called above.
101
     */
102
 
103
    /*
104
     * Specify a user-specific startup file to invoke if the application
105
     * is run interactively.  Typically the startup file is "~/.apprc"
106
     * where "app" is the name of the application.  If this line is deleted
107
     * then no user-specific startup file will be run under any conditions.
108
     */
109
    Tix_SetRcFileName(interp, "~/.tixwishrc");
110
 
111
    return TCL_OK;
112
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.