Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Tcl JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README update
demo1.html restructured into subinterps, documented
demo2.tcl cleanup
httpd.tcl initial commit
server.tcl added freehand sketch example
sketch.tcl added visual color palette
wtk-base.tcl renamed _stdwidget as _wtkwidget, added -usetextvar to replace separa…
wtk-grid.tcl broke up wtk.tcl into multiple files
wtk.js objectified canvas code, added item hit detection, deferred drawing
wtk.test checkbuttons


Requires Snit.  Run tclsh8.5 server.tcl and open your browser to http://localhost:9001

I've recently started putting together a Tk-over-jQuery routine I'm calling web Tk (wtk). The idea is having full Tcl running on a server, with a Tk-like layer that sends commands to code running in a browser.

For those of you who remember it, this is conceptually similar to ProxyTk (see

An important thing is that its not tied into any particular web server or other communication channel; in fact, it just assumes there is a communication channel of some sort. This might be an AJAX connection pair, WebSockets,, etc. Or it might not even be a remote communication. You could well have a desktop/iPad app whose UI is a web view, and the "communication" between "server" and "client" might be just a procedure call.

The implementation is based on Snit, and the demo uses simple Ajax communication over a generic minihttpd.tcl-derived web server. Incidentally, while I've never really used Snit before, it's a clear win for this type of thing; you'll see from the widget code that the amount of overhead needed to translate the "tk-like" commands into Javascript/jQuery calls is fairly minimal. This is important as I want to make this very easy for people to extend, wrap other jQuery widgets, etc.

It's still at what I'd consider the proof of concept stage, but it feels very promising.

Something went wrong with that request. Please try again.