summaryrefslogtreecommitdiff
path: root/tix/docs/Pkg.txt
blob: a6972021ba0d00f5ae25265040f6b29da9944161 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
	                -------------------
		        Dynamic Loading Tix
			-------------------

   In this text, the phrase "a version of Tcl" stands for a version of
   Tcl from the standard Sun distribution or the ITcl distribution.

BINARY VERSION
==============

    Tix can be built to work with different versions of Tcl.  A Tix
    dynamic library built for a particular version of Tcl works only
    with that version. To make it possible to install Tix binaries
    that support multiple versions of Tcl, and prevent the loading of
    Tix binaries into incompatible versions of Tcl, Tix uses a special
    "binary versioning" system:


    BINARY VERSION FOR STANDARD TCL DISTRIBUTION

        If you use Tix version a.b and build a Tix binary file for Tcl
        version x.y, the "binary version" of this Tix binary file will
        be a.b.x.y. For example, if you build the Tix 4.1 shared
        library for Tcl 7.6, the binary version is 4.1.7.6.
    
    BINARY VERSION FOR ITCL DISTRIBUTION

	If you use Tix version a.b and build a Tix binary file for an
	ITcl distribution which contains Tcl version x.y., the "binary
	version" of this Tix binary file will be a.b.x.y.1. For
	example, if you build the Tix 4.1 shared library for Itcl 2.2
	(which contains Tcl 7.6), the binary version is 4.1.7.6.1.

    In short, the extra ".1" version number indicates whether a Tix
    binary is compile for standard Tcl or Itcl.

    Naming of shared libraries
    ==========================

        A Tix shared library compiled for a standard Tcl distribution
        is named libtix${BIN_VERSION}${SHLIB_SUFFIX}. For example,
        with Tix version 4.1 and Tcl version 7.6:

		libtix4.1.7.6.so
	
        With Tix version 4.1 and ITcl version 2.1 (which includes Tcl
        version 7.5):

		libtix4.1.7.5.1.so

    Naming of executable files
    ==========================

	The Tix executable (which contains Tcl, Tk and Tix) is called
        "tixwish${BIN_VERSION}". For example, the executables for the shared
        libraries mentioned above are

		tixwish4.1.7.6
		tixwish4.1.7.5.1

GENERATING A TIX BINARY VERSION
===============================

    The following Tcl procedure can be used to generate a Tix binary
    version for a particular version combination of Tix and Tcl:

	proc tixBinVer {tixVer} {
	    global tcl_version

	    if {[string compare [info command @scope] ""]} {
	        # We are running inside Itcl
		return $tixVer.$tcl_version.1
	    } else {
		return $tixVer.$tcl_version
	    }
	}
	
LOADING TIX WITH THE "load" COMMAND
===================================

    To dynamic load Tix with the "load" command, you can use the
    tixBinVer procedure to generate a Tix binary version number. If
    the Tix 4.1 shared library is located in the directory $dir, it
    can be loaded by

      load [file join $dir libtix[tixBinVer 4.1][info sharedlibextension]] Tix

    The above command may not work on platforms that do not support
    the "." character inside shared library names. For example, on
    SunOS, the command must be modified as:

      set ver [tixBinVer 4.1]
      regsub -all {[.]} $ver "" ver
      load [file join $dir libtix$ver[info sharedlibextension].1] Tix

    To avoid the need of platform specific code and having to hard
    code the location of the shared into your scripts, it's
    recommended you use instead the "package require" command to load
    a Tix dynamic library, as outlined below.

LOADING TIX WITH THE "package require" COMMAND
==============================================

    If you have properly installed Tix in your system, you can
    dynamically load Tix with the following command:

	package require -exact Tix [tixBinVer 4.1] 

    Note that the "-exact" switch must be used so that only a
    Tix shared library compatible with the given version of Tcl is
    loaded. (If you omit the -exact switch, "package require" may load
    in Tix 4.1.7.6 even the correct version should be 4.1.7.5.1.)

LOADING TIX SAM WITH THE "package require" COMMAND
==================================================

    The Tix StandAlone Module (SAM), when properly installed, can also
    be loaded using the "package require" command:

	package require -exact Tixsam [tixBinVer 4.1] 

    Note: when you load it the "Tixsam" package, the Tix package will
    be loaded automatically. You need not, and must not, "package
    require" the Tix package at the same time.

    Read the file docs/SAModules.txt for more details on StandAlone
    Modules.