- "We" implement a mechanism to run other Tcl applications
- "We" use the Wiki as a repository for Tcl plugin demonstrations and more serious applications
RS Um.. somehow this goes in the direction of remote Tclets - without Tcl/Tk Tclet Plugin. As I wrote Fun with functions, let's consider what would be needed in that case:
- an interface where new user input (a string) would come in
- the function graph is rendered on a canvas, so we'd need a screenshot (using Img)
- This requires that the app is on-screen, and not covered by other windows :(
- If that can be assured, making a screenshot and saving it to a designated image file (GIF or JPEG) is a matter of a few lines of code
set im [image create photo -data .c] ;# or whatever the canvas is called $im write $filename -format JPEG # notify Wub that it can refresh the served pageAM You can do that with:
raise . tkwait visibility . set im [image create photo -data .c -format window] $im write $filename -format JPEG # notifiy Wub ...Some problems: the server may not have an X Display to work with and you could get race conditions (two users who both want their windows to show up on top at the same time). Then it would be best to use a frame buffer instead of a visible X Window window.LV Security issues would need to be addressed, to prevent people from performing destructive operations. I suspect that something making use of safetcl/safe interps would help.DKF: I know (from private communication) that Gerald Lester is working on an application server idea where the basic plan is to run the whole application inside a safe interpreter with resources (databases, web services, log files, etc.) aliased in from the outside world according to a descriptor that can be vetted by the administrator. It seems like an awesome idea (speaking as someone who writes that sort of thing for a living) and it uses the power of Tcl to great effect. But he should write it up publicly, not me.