First some background on what is happening behind the scenes...
Starkits rely on a feature of Tcl/Tk 8.4 called the Virtual File System (VFS). Through the magic of VFS, a starkit gets "mounted" at run time, such that it appears to contain a directory structure. Because of this, application scripts can load other scripts and open data files, even while running as starkit. The trick is to set up a structure which works in unpacked form while coding and testing, and which can later be assembled into an equivalent packaged starkit.
To build starkits on Windows, you need
- the Windows version of tclkit (Tcl/Tk, GUI mode) - see Downloading tclkit
- the Windows version of tclkitsh (Tcl/Tk, console mode) - see Downloading tclkitsh
- the SDX utility - see Downloading SDX
To build starkits on Unix, you need
- a suitable Unix version of tclkit - see Downloading tclkit
- the SDX utility - see Downloading SDX
At this point, you should be able to type "sdx" at the console prompt, and have SDX return a few lines of explanatory info.
STEP 1 - Hello world
- create a file "hello.tcl" with the following two lines of text:
package require Tk
pack [button .b -text "Hello World!" -command bell]
- use the "qwrap" option to quickly turn a single script into a starkit:
sdx qwrap hello.tcl
- the result is a file called "hello.kit"
- on Windows, SDX will also create a file "hello.bat"
- type "hello" on Windows, or "./hello.kit" on Unix
- you'll see a window with button which beeps when clicked
STEP 2 - Unwrap
- now unwrap this starkit, to examine its contents:
sdx unwrap hello.kit
- the result are unwrapped into "hello.vfs/"
- the startup script is at "hello.vfs/main.tcl"
- what you end up with is a standard starkit directory layout
STEP 3 - Make changes
- you can run your app unwrapped, using "tclkit hello.vfs/main.tcl"
- the original script is now in "hello.vfs/lib/hello.tcl"
- feel free to extend it, make changes, etc.
- you can add packages to "hello.vfs/lib/" and they'll be found
- repeat this step as often as needed to get things just right
STEP 4 - Wrap it up
- whenever you want to create an updated starkit, do:
sdx wrap hello.kit
- this takes "hello.vfs/" as input, and overwrites "hello.kit"
- as before, that can be run with "hello" (Windows) or "./hello.kit" (Unix)
For more examples, see:
There's a mailing list for discussion about starkits, starpacks, and tclkit:
/mailman/listinfo/starkit
Updated on 10 Jul 2002, 15:08 GMT
Search - Recent Changes - 4 References - About WiKit - Go to Starkit - Help