Tk Widgets in Javascript Paper Chapter 1

  • How it started

During the implementation of incr Tcl in Javascript there did raise the question, how to get easy and efficient access to the DOM information. First idea was to give a user direct access to javascript DOM commands using a Tcl wrapper, but that would force the user to learn a lot of javascript and its model for widgets and events. So after some thoughts in that direction it seemed better to try to map Tk functionality to javascript DOM and event model. There followed the decision on directly using DOM for the implementation without first using HTML code and let the browser convert that to the DOM info. Next there was the need to find out how to map basic Tk widgets to the DOM model like: button entry frame label toplevel

As I had in mind to use that as a client/frontend for Reporting Tools with Tcl, these were the base widgets for starting. After some experiments I decided to use

 <div>

for a label widget,

 <button>

for a button widget,

 <input>

for an entry widget and again

 <div>

for a frame widget and a toplevel widget.

(Part of Tk Widgets in Javascript Paper)