Version 1 of RenderTk

Updated 2015-01-20 12:51:42 by GeorgePetasis

RenderTk, version 0.000001 :-)

This page is about RenderTk, a package that tries to "emulate" a *tiny* part of Tk, and "render" it as HTML. Emphasis should be given to "tiny" (much of Tk is not supported), and "render" (the Tk UI is converted in HTML tags, the resulting HTML does not function as the original Tk code. It only "draws" the Tk UI).

Why RenderTk?

I needed a way to "convert" a Tk UI into an HTML UI (using AngularJS). I would like very much to use WubTk, but I had the following limitations:

  • I was not using Wub, I was using Apache Rivet, inside the Apache 2 web server.
  • Tk was not available, I had no X Server the Apache 2 server could connect to.

Initially, I tried to modify WubTk, in order to remove dependencies to Wub and Tk, and I ended writting RenderTk. So, RenderTk was inspired by WubTk, and to some extend it borrowed its implementation, as it started from the WubTk implementation.

What is new

RenderTk tries to mimic Tk as much as possible. This means, that I didn't like the fact that WubTk used "grid" in a strange way, and you have to use cell coordinates to all widgets. This means that you can never use the same Tk code. So, I desided that the grid command must be emulated, and I did it: RenderTk has a (partial) implementation of grid in Tcl. I did this by translating the C code from Tk internals into Tcl. Maybe not the fasted approach, but for sure the most compatible... :-)

What is missing

Almost everything. As a start, interaction of any kind with the rendered UI.

The code