Error processing request
Parameters
CONTENT_LENGTH | 0 |
REQUEST_METHOD | GET |
REQUEST_URI | /revision/A+Simple+Multi%2DFile+Starkit+Example?V=12 |
QUERY_STRING | V=12 |
CONTENT_TYPE | |
DOCUMENT_URI | /revision/A+Simple+Multi-File+Starkit+Example |
DOCUMENT_ROOT | /var/www/nikit/nikit/nginx/../docroot |
SCGI | 1 |
SERVER_PROTOCOL | HTTP/1.1 |
HTTPS | on |
REMOTE_ADDR | 172.69.58.126 |
REMOTE_PORT | 50836 |
SERVER_PORT | 4443 |
SERVER_NAME | wiki.tcl-lang.org |
HTTP_HOST | wiki.tcl-lang.org |
HTTP_CONNECTION | Keep-Alive |
HTTP_ACCEPT_ENCODING | gzip, br |
HTTP_X_FORWARDED_FOR | 3.144.243.184 |
HTTP_CF_RAY | 87a1e083e80e10fe-ORD |
HTTP_X_FORWARDED_PROTO | https |
HTTP_CF_VISITOR | {"scheme":"https"} |
HTTP_ACCEPT | */* |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected]) |
HTTP_CF_CONNECTING_IP | 3.144.243.184 |
HTTP_CDN_LOOP | cloudflare |
HTTP_CF_IPCOUNTRY | US |
Body
Error
Unknow state transition: LINE -> END
-code
1
-level
0
-errorstack
INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {A Simple Multi-File Starkit Example} {You can find an example of turning a simple single file hello.tcl into a [Starkit] under the title [Build Your First Starkit]. This page's tutorial takes you beyond a simple single file hello.tcl '''Starkit''' into a multi-file program hello.tcl '''Starkit'''. The code presented here was developed quickly after chatting in the ''Tkchat'' application. This example is going to show how to start without using the qwrap method. It's quite easy.
'''1. Create the following directory structure:'''
Hello.vfs/
Hello.vfs/lib/
Hello.vfs is where our code will go and Hello.vfs/lib is where any extensions may be placed.
'''2. Create the main.tcl file under the Hello.vfs directory. Let's get starkit up and running, by putting the following code into the file:'''
package require starkit
if {[starkit::startup] ne "sourced"} {
source [file join $starkit::topdir hello.tcl]
}
Two things are notable about the above code. The ''starkit::startup'' function must be called to initialize the starkit. It
returns a value that tells you something about the running environment. Handling 'sourced' like this enables you to load the
vfs into a running interpreter for interactive debugging (ie: start tkcon, source the kit file and call the program initialization functions manually).
The ''starkit::topdir'' variable is initialized by ''starkit::startup'' to give the path to the top of the vfs tree. This
method should always be used to find this location as it handles details on how the starkit/starpack/vfstree has been loaded.
'''3. Now we create our application in simple Tcl/Tk. No need to deal with or know about '''Starkit''' from here on out. We do, however, have to take special consideration during the sourcing of other files. Create this hello.tcl file under the Hello.vfs directory:'''
package require Tk
# Get the current scripts directory
# Source in the supporting file with the current scripts
# directory as it's base
source [file join $starkit::topdir funcs.tcl]
# The example code
button .hello -text "Say Hello" -command { sayHello "World" }
pack .hello -padx 5 -pady 5 -expand 1 -fill both
'''4. Create the "sourced" file, funcs.tcl also in the Hello.vfs directory:'''
# Supporting functions
proc sayHello {toWho} {
tk_messageBox -icon info -type ok -title "Saying Hello" -message "Hello, $toWho"
}
'''5. Now you can wrap it with the sdx command:'''
sdx wrap Hello.kit
'''6. and run your new multi-file '''Starkit''':'''
tclkit Hello.kit
Now, the nice thing about this method is that you can also develop/test/run/deploy code as a standard Tcl/Tk app as well.
wish Hello.vfs/main.tcl
or
tclkit Hello.vfs/main.tcl
or even
tkcon Hello.vfs/main.tcl
are all equivalent to running a wrapped version
tclkit Hello.kit
In the end my directory entire project structure looks like:
HelloProject/
HelloProject/Hello.vfs/
HelloProject/Hello.vfs/main.tcl
HelloProject/Hello.vfs/hello.tcl
HelloProject/Hello.vfs/funcs.tcl
HelloProject/Hello.vfs/lib/
At a later date (once I have it all working) I'll add in my Makefile that gives me simple commands like:
make kit
make exe
make run-tcl
make run-kit
make run-exe
This page was created by a novice, so your milage may vary. Please, comment on this if you have further instructions or better ways of doing it.
----
**Discussion**
During July, 2010 in [comp.lang.tcl] the thread [http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/e9318c3ea80a98ce/f01995821f6b2acb?tvc=1#f01995821f6b2acb%|%How to create a starpack with multiple tcl files and other packages], a discussion arose about dealing with starkits and [tcl modules]. One of the take aways from the discussion is that code similar to
======code
package require starkit
starkit::startup
if {[package vsatisfies [package require Tcl] 8.5]} {
::tcl::tm::path add [file join $starkit::topdir lib]
}
starkit::autoextend [file join $starkit::topdir lib tcllib]
starkit::autoextend [file join $starkit::topdir lib tklib]
package require appwits
======
(where appwits is a package included in the starkit) should be included the starkit's main.tcl.
----
!!!!!!
%| [Category Tclkit] | [Category Deployment] |%
!!!!!!} regexp2} CALL {my render {A Simple Multi-File Starkit Example} {You can find an example of turning a simple single file hello.tcl into a [Starkit] under the title [Build Your First Starkit]. This page's tutorial takes you beyond a simple single file hello.tcl '''Starkit''' into a multi-file program hello.tcl '''Starkit'''. The code presented here was developed quickly after chatting in the ''Tkchat'' application. This example is going to show how to start without using the qwrap method. It's quite easy.
'''1. Create the following directory structure:'''
Hello.vfs/
Hello.vfs/lib/
Hello.vfs is where our code will go and Hello.vfs/lib is where any extensions may be placed.
'''2. Create the main.tcl file under the Hello.vfs directory. Let's get starkit up and running, by putting the following code into the file:'''
package require starkit
if {[starkit::startup] ne "sourced"} {
source [file join $starkit::topdir hello.tcl]
}
Two things are notable about the above code. The ''starkit::startup'' function must be called to initialize the starkit. It
returns a value that tells you something about the running environment. Handling 'sourced' like this enables you to load the
vfs into a running interpreter for interactive debugging (ie: start tkcon, source the kit file and call the program initialization functions manually).
The ''starkit::topdir'' variable is initialized by ''starkit::startup'' to give the path to the top of the vfs tree. This
method should always be used to find this location as it handles details on how the starkit/starpack/vfstree has been loaded.
'''3. Now we create our application in simple Tcl/Tk. No need to deal with or know about '''Starkit''' from here on out. We do, however, have to take special consideration during the sourcing of other files. Create this hello.tcl file under the Hello.vfs directory:'''
package require Tk
# Get the current scripts directory
# Source in the supporting file with the current scripts
# directory as it's base
source [file join $starkit::topdir funcs.tcl]
# The example code
button .hello -text "Say Hello" -command { sayHello "World" }
pack .hello -padx 5 -pady 5 -expand 1 -fill both
'''4. Create the "sourced" file, funcs.tcl also in the Hello.vfs directory:'''
# Supporting functions
proc sayHello {toWho} {
tk_messageBox -icon info -type ok -title "Saying Hello" -message "Hello, $toWho"
}
'''5. Now you can wrap it with the sdx command:'''
sdx wrap Hello.kit
'''6. and run your new multi-file '''Starkit''':'''
tclkit Hello.kit
Now, the nice thing about this method is that you can also develop/test/run/deploy code as a standard Tcl/Tk app as well.
wish Hello.vfs/main.tcl
or
tclkit Hello.vfs/main.tcl
or even
tkcon Hello.vfs/main.tcl
are all equivalent to running a wrapped version
tclkit Hello.kit
In the end my directory entire project structure looks like:
HelloProject/
HelloProject/Hello.vfs/
HelloProject/Hello.vfs/main.tcl
HelloProject/Hello.vfs/hello.tcl
HelloProject/Hello.vfs/funcs.tcl
HelloProject/Hello.vfs/lib/
At a later date (once I have it all working) I'll add in my Makefile that gives me simple commands like:
make kit
make exe
make run-tcl
make run-kit
make run-exe
This page was created by a novice, so your milage may vary. Please, comment on this if you have further instructions or better ways of doing it.
----
**Discussion**
During July, 2010 in [comp.lang.tcl] the thread [http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/e9318c3ea80a98ce/f01995821f6b2acb?tvc=1#f01995821f6b2acb%|%How to create a starpack with multiple tcl files and other packages], a discussion arose about dealing with starkits and [tcl modules]. One of the take aways from the discussion is that code similar to
======code
package require starkit
starkit::startup
if {[package vsatisfies [package require Tcl] 8.5]} {
::tcl::tm::path add [file join $starkit::topdir lib]
}
starkit::autoextend [file join $starkit::topdir lib tcllib]
starkit::autoextend [file join $starkit::topdir lib tklib]
package require appwits
======
(where appwits is a package included in the starkit) should be included the starkit's main.tcl.
----
!!!!!!
%| [Category Tclkit] | [Category Deployment] |%
!!!!!!}} CALL {my revision {A Simple Multi-File Starkit Example}} CALL {::oo::Obj1174893 process revision/A+Simple+Multi%2DFile+Starkit+Example} CALL {::oo::Obj1174891 process}
-errorcode
NONE
-errorinfo
Unknow state transition: LINE -> END
while executing
"error $msg"
(class "::Wiki" method "render_wikit" line 6)
invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
(class "::Wiki" method "render" line 8)
invoked from within
"my render $name $C"
(class "::Wiki" method "revision" line 31)
invoked from within
"my revision $page"
(class "::Wiki" method "process" line 56)
invoked from within
"$server process [string trim $uri /]"
-errorline
4