body { margin:0px; background-color:#fff } img { margin:0px; border-style:none } button { margin:0px; border-style:none; padding:0px; background-color:transparent; vertical-align:top } p:first-child { margin-top:0px } table { empty-cells:hide } .f-sp { font-size:1px; visibility:hidden } .f-lp { margin-bottom:0px } .f-x1 { } .f-x2 { } .f-x3 { } a:visited { color:#8b0000; text-decoration:underline } .capsub { color:#808080; font-weight:bold; text-transform:uppercase; letter-spacing:2.4px } .bold { color:#00f; font-weight:bold } .bulletlist { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0.1px } .fixed { color:#000; font-family:monospace } .rightaligned { margin-left:0px; margin-right:0px; text-align:right; margin-top:0px; margin-bottom:0.1px } .footer { color:#808080; font-size:90% } .FWExtra { } .FWExtra a:link { text-decoration: none; } .FWExtra a:active { text-decoration: none; } .FWExtra a:visited { text-decoration: none; } .FWExtra a:hover { text-decoration: underline; } -->
top pageS
Soapbox
Blog Company
About
| so you want to use starkits, eh? The very first time you read about Starkits and Tclkits, you may feel ovewhelmed. So how does one get started on this? Here's a quick example, which takes Keith Vetter's Fractal Mountains demo as starting point and explains how to modify it. assumptions
get three files You will need Tclkit. Get the one matching your platform from the download area.
The Linux and Mac binaries need to be unpacked, renamed, and made runnable: gzip -d tclkit-*.gz Now download the Fractal Mountains demo from http://mini.net/sdarchive/fractal.kit Test it, by running "tclkit fractal.kit". You will see a neat little Tk-based demo. Last step is to get SDX, the Starkit Developer eXtension which contains a few small tools which make it easy to wrap and unwrap starkits and starpacks. Get SDX from /pub/sk/sdx.kit - it's a starkit, you can try it with "tclkit sdx.kit". you now have the technology As you saw, tclkit + fractal.kit is enough to run a small Tcl.Tk application. Now let's take it apart - type: tclkit sdx.kit unwrap fractal.kit You will get a directory called "fractal.vfs". It has "fractal.vfs/main.tcl" - which is what always needs to run first to start up. And a directory called "fractal.vfs/lib", with inside it "fractal.vfs/lib/app-fractal/fractal.tcl" - that's the fractal app code. Make some changes. Then run the (unwrapped!) result using: tclkit fractal.vfs/main.tcl As you can see, main.tcl will execute the fractal app code. It does that by doing a "package require app-fractal" as last step. This works, because starkits are set up to find packages in their internal "lib" directory. There is no magic - these conventions just make starkits easy to use and extend: Tcl's $auto_path is adjusted by main.tcl when launched, this works in unwrapped as well as in wrapped mode. Once you understand how main.tcl and fractal.tcl work together, you have all the machinery worked out to use them yourself. You can add other packages to the "lib" directory to include them. To create a new adjusted fractal.kit, wrap it by typing: tclkit sdx.kit wrap fractal.kit SDX will take all of "fractal.vfs" and wrap it up, overwriting "fractal.kit". Now ship it! | tclkit index • Overview • Download • Links | |||