Tclkit: Difference between revisions

1,462 bytes added ,  13 years ago
Fill out with some info
(Expanded explanation)
(Fill out with some info)
Line 1:
{{stub}}{{implementation|Tcl}}
'''tclkit''' and '''tclkitsh''' are single-file distributions of Tcl (based on [[libtcl]][[Category:libtcl]]) that can be launched without prior installation; they store all auxiliary files in an internal filesystem-in-a-database. The main difference between tclkit and tclkitsh is on Windows, where the former is built as a graphical application (so not using real stdio) and the latter as a console application (forcing the opening of a console window if run from Explorer); these differences are a feature of the Windows platform. (The difference between <tt>java</tt> and <tt>javaw</tt> for [[Java]] runtimes is analogous.)
 
Tools are available for simply building user applications into single file distributions based on tclkit, through concatenating a further filesystem-database file. Since this technique is orthogonal (and largely transparent) to the application, it has become a very popular technique for distributing applications implemented in Tcl.
 
== Building an Application with Tclkit ==
Note that unlike the [http://wiki.tcl.tk/10558 source for this material], this quick tutorial assumes that you already have things installed.
 
=== Write your application ===
Save this into a file <tt>hello.tcl</tt>:
<lang tcl>package require Tk
pack [button .b -text "Hello World!" -command bell]</lang>
=== Wrap your application ===
At the shell command line, type this:
<lang bash>SDX="tclkit sdx.kit"
$(SDX) qwrap hello.tcl</lang>
=== Test your application ===
<lang bash>tclkit hello.kit</lang>
=== Unwrap and rewrap with the full runtime attached ===
<lang bash>$(SDX) unwrap hello.kit</lang>
That creates a directory, <tt>hello.vfs</tt>, that contains the packaged application. This is when you would copy into there any libraries – either pure scripted or compiled from some other language, e.g., [[C]] – that you wanted to distribute with your application. Then you rewrap it into a full, self-contained executable like this:
<lang bash>$(SDX) wrap hello -vfs hello.vfs -runtime `which tclkit`</lang>
 
== See Also ==
* [http://www.equi4.com/tclkit/ Description, fully-supported builds]
** [http://www.equi4.com/starkit/sdx.html Tool for building and working with tclkit-packaged applications, <tt>sdx.kit</tt>]
* [http://www.patthoyts.tk/tclkit/ Bleeding-edge builds]
* [http://wiki.tcl.tk/52 Tclkit on the Tcler's Wiki]
Anonymous user