| 1 | /* |
| 2 | * tkInitScript.h -- |
| 3 | * |
| 4 | * This file contains Unix & Windows common init script |
| 5 | * It is not used on the Mac. (the mac init script is in tkMacInit.c) |
| 6 | * |
| 7 | * Copyright (c) 1997 Sun Microsystems, Inc. |
| 8 | * |
| 9 | * See the file "license.terms" for information on usage and redistribution |
| 10 | * of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 11 | * |
| 12 | * RCS: @(#) $Id: tkInitScript.h,v 1.8 1999/04/16 01:51:15 stanton Exp $ |
| 13 | */ |
| 14 | |
| 15 | |
| 16 | |
| 17 | /* |
| 18 | * In order to find tk.tcl during initialization, the following script |
| 19 | * is invoked by Tk_Init(). It looks in several different directories: |
| 20 | * |
| 21 | * $tk_library - can specify a primary location, if set |
| 22 | * no other locations will be checked |
| 23 | * |
| 24 | * $env(TK_LIBRARY) - highest priority so user can always override |
| 25 | * the search path unless the application has |
| 26 | * specified an exact directory above |
| 27 | * |
| 28 | * $tcl_library/../tk$tk_version |
| 29 | * - look relative to init.tcl in an installed |
| 30 | * lib directory (e.g. /usr/local) |
| 31 | * |
| 32 | * <executable directory>/../lib/tk$tk_version |
| 33 | * - look for a lib/tk<ver> in a sibling of |
| 34 | * the bin directory (e.g. /usr/local) |
| 35 | * |
| 36 | * <executable directory>/../library |
| 37 | * - look in Tk build directory |
| 38 | * |
| 39 | * <executable directory>/../../tk$tk_patchLevel/library |
| 40 | * - look for Tk build directory relative |
| 41 | * to a parallel build directory |
| 42 | * |
| 43 | * The first directory on this path that contains a valid tk.tcl script |
| 44 | * will be set ast the value of tk_library. |
| 45 | * |
| 46 | * Note that this entire search mechanism can be bypassed by defining an |
| 47 | * alternate tkInit procedure before calling Tk_Init(). |
| 48 | */ |
| 49 | |
| 50 | static char initScript[] = "if {[info proc tkInit]==\"\"} {\n\ |
| 51 | proc tkInit {} {\n\ |
| 52 | global tk_library tk_version tk_patchLevel\n\ |
| 53 | rename tkInit {}\n\ |
| 54 | tcl_findLibrary tk $tk_version $tk_patchLevel tk.tcl TK_LIBRARY tk_library\n\ |
| 55 | }\n\ |
| 56 | }\n\ |
| 57 | tkInit"; |
| 58 |