Already during implementing incr tcl in javascript there was the decision to use wtk as the frontend for GUI building. wtk (WebTk) is a Tk like implementation of some widgets (frame, entry, button, label, checkbutton and canvas) and a rudimentary implemenation of a grid manager. It is based on the idea to separate the data and administration part of the GUI from the presentation part. The communication between the two parts can be done in different ways:
The base for the above implementation is a snit class widget, which can create and administrate a widget. It is (from the comment of the implementation of Mark Roseman): A 'generic' widget object, which handles routines common to all widgets like assigning it an id, keeping track of whether or not it has been created, etc. Purely for convenience, we also include some code here that manages widgets that use -text or -textvariable, though not every widget will do so.
The “mega”widgets like frame, button, entry etc. are built with snit classes, which delegate a lot of functionality to the widget base class. Again a comment from Mark Roseman from the implementation:
Wtk.js is a set of functions building the base of the repesentation/displaying (client side) part.
Communication between the administrative side and the displaying side is done using two global procs:
These classes and procs have been used to implement a running version in incr tcl in javascript using a few javascript classes to allow the direct communication with the interpreter written in javascript.