Version 26 of Porting a Tk GUI to A Web Browser

Updated 2010-03-09 16:29:30 by Cameron

In the comp.lang.tcl newsgroup, I asked: "Does anyone here have any thoughts or pointers into the Wiki, or to papers that might help us port our current Tcl-Tk GUIs to a browser without re-coding in Java?"

I received the following suggestions:

  • Marty Backe suggested tcljava and swank, "particularly the latter." CL observes that Swank is for use with the Jacl part of Tcljava.
  • Tom Poindexter suggested: "You might try WeirdX, it's an X11 server written in Java, and runs as a browser applet. I've used this in the past to deliver Tcl/Tk applications for internal users. It's suitable for running on fast, secure networks."
  • Tom also suggests: "Proxy Tk would also be an idea, but to my knowledge, it never made it into public consumption". Bryan Oakley also offered the same suggestion, continuing: "The short summary is, you write tk on the server which drives a thin client that translates the tk commands into java widgets in the client. The software isn't available, but it looks like a fairly straight-forward thing to reinvent. Unless your guis are trivial, it may take less effort to reinvent proxytk than it would be to recode all of the GUIs in Java."
  • Several folks suggested VNC. As of 2006, CL is doing a lot of work with VNC-in-a-browser; expect this to become public in late September.
  • Donal Fellows suggested: "If you end up having to do Java GUIs, start by porting the Tk geometry managers to Java as the standard ones are not really very good (GridBagLayout sucks a lot more than you might think at first. Trust me.) That'll save you much frustration."
  • Roy Terry suggested: "You can run Tcl/Tk as an activeX object using TclControl. I believe, but haven't done the work, that you could also package the tclcontrol along with the needed Tcl/Tk dlls, etc. into a CAB file and have the whole thing download seamlessly on Windows." A paper [L1 ] provides details.
  • CL also believes that good engineering judgment in such a matter depends on details. Is the GUI just a buttons-and-entry form-oriented office-automation sort of thing, or does it involve a lot of canvas sophistication? What network characteristics can be assumed? What security and licensing models are involved?
  • Roy Keene suggested: It should be possible to emulate the Tk functionality in Tcl, and also provide an HTML rendering engine for the psuedo-Tk widgets in HTML. An incomplete example [L2 ] [L3 ] is available for examination. A Tkweb screenshot http://www.rkeene.org/viewer/projects/tkweb/tkweb-test1-2.png.htm is also available. This method is also discussed by Wilfred J. Hansen [L4 ] .
  • Æjaks Although not directly compatible with Tk, Æjaks provides a very similar programming model.
  • By 2010, HTML5 has caught up sufficiently to offer canvas, SVG, and other interesting advances that duplicate parts of Tk's style.

Eventually this goes in the same direction: Matthias Hoffmann - Thoughts And Ideas|Generating HTML with commands styled after Tk??


Category Internet | Category GUI