| [ Team LiB ] |
|
Getting Started with TclkitUsing Tclkit is easy. Just copy the version for your platform (e.g., Linux, Windows or Solaris) into a convenient location under the name tclkit (or tclkit.exe on Windows.) The CD-ROM has builds for lots of platforms, and you can find more at the Tclkit home page: You can use the tclkit application just like tclsh. Run with no arguments, it prints a prompt and you can type Tcl commands interactively. If you pass a file argument, then it sources that file just as tclsh would. To use tclkit like wish, you must add this to your scripts: package require Tk Although you can use tclkit to source .tcl files, tclkit is normally used to interpret Starkits, which have a .kit suffix. On UNIX, Starkits use the #! header to associate themselves with tclkit. Make sure that tclkit is in a directory named in your PATH environment variable. On Windows, you can associate tclkit.exe with the .kit extension. Mac OS X behaves like UNIX (yay!). On Mac Classic systems you can use the File Source menu to source .kit files. Creating Starkits is described on page 352. Inside a StarkitTclkit uses the Virtual Filesystem extension to make records in a Metakit database look like files and directories to your application. Through a simple packaging step described shortly, you can easily put all of the Tcl scripts and other supporting files that make up your application into a single database file. The Virtual Filesystem (VFS) extension lets you transparently access these files through the regular file system interface (e.g., open, gets, source, even cd.) A Starkit is a Metakit database that stores an application. The great thing about a Starkit is that it is a single file so it is easy to manage. There is no need to unpack files or run an installer to set things up. Instead, you can distribute your application as two files: the Tclkit interpreter and the Starkit file. Both of these embed a virtual file system that include all the bits and pieces needed for Tcl/Tk and your application. The Tclkit file is platform-specific because it contains Tcl and all the other extensions in a compiled form. There are pre-compiled Tclkits for Windows, Macintosh, and many flavors of Unix. The Starkit file is platform-independent. You can use it with the appropriate Tclkit interpreter on different platforms. Deploying Applications as StarkitsThe key benefit of Tclkit and Starkits is easy deployment. Users just copy tclkit and your Starkits onto their system; there is no special installation step. You can even have different versions of tclkit and they don't interfere with each other. If users get tired of your application, they just remove the files. Creating Starkits is made easy with the sdx application, which was created by Steve Landers and Jean-Claude Wippler. You organize your collection of application scripts, data files, binary graphics, and online documentation into a file system directory structure. Then you use sdx to wrap that into a Starkit. Creating your own Starkits is described on page 352. You can include binary extensions in a Starkit and dynamically load them. The load command automatically copies the shared library out of the VFS to a temporary location, and loads the library from that location. The temporary file is necessary because the host OS cannot find the library inside the Starkit. Binary extensions make the Starkit platform-specific, but it is possible to put libraries for different platforms into the Starkit. For example, the kitten.kit Starkit includes extensions for Windows, Linux, and Solaris. You can combine Tclkit and a Starkit into a Starpack. The advantage of this is that it reduces deployment to a single file. The main drawback is that the Starpack file is relatively large, and it is platform-specific. Use sdx to create Starpacks as described later. The Starkit archive contains a growing collection of Starkits that include applications, games, development tools, a Wiki, tutorials and documentation bundles. There is a copy of the archive on the CD-ROM, and its home page is: |
| [ Team LiB ] |
|