Embedding Tk in an MFC application



Hello everyone,

We've got an MFC application (a test automation tool) which has an
embedded Tcl interpreter so the application can run test scripts
written in Tcl. So far we've been using just Tcl without the Tk part
but now we'd like to be able to have our Tcl scripts create dialogs,
popups etc ... which is why the Tk part is also required now.

Notice a test script as run in our tool does not necessarily HAVE to
use any Tk windows, but some scripts may use them to request input from
the user, etc. I have only a very vague understanding of what must be
done to set up the interpreter so it is Tk-capable, so I'd definitely
appreciate some good advice.

So far I'm aware of the following differences:

- must link against Tk84.lib as well (not just Tcl84.lib)
- need to include tk.h
- need to ship Tk84.dll with the application

Will I have to ship any additional files?

Also, I think setting up the interpreter will look something like this
(pseudo code):

1) call Tcl_CreateInterp()
2) Tcl_FindExecutable()
3) Tcl_Init()
4) Tk_Init()
5) done ??
6) Tcl_Eval( whatever_script_the_user_is_running )


By the way, the interpreter is created in a separate thread from the
GUI thread of the application.

Does this look right? Did I forget anything? Are there any additional
things I need to look out for? Thanks in advance for any helpful
replies!

Cheers,

ant

.



Relevant Pages

  • Tcl thread local storage memory problem
    ... I am working on an application that originally uses one thread, TCL ... and the C-library to initialize an interpreter and executing standard ... InitializeThreadLocalStorage(); /*If no threads, initialize ... able to get Tcl thread local storage ...
    (comp.lang.tcl)
  • Re: File data format
    ... This is how I always look at data processing with Tcl: ... then let the very effecient tcl interpreter do the parsing. ... Create procs that match the data keys. ... date, commit, and compile, that matched the same signature, then your ...
    (comp.lang.tcl)
  • Re: No argv, argc for worker thread
    ... I expected that a Tcl interpreter started in any manner would accept options ... This is how the interpreter works with command line options ... a "main" script processes command line ...
    (comp.lang.tcl)
  • Re: Tcl/TK is indeed dying
    ... A fat Tcl interpreter has impact to all wanting to see Tcl linked to ... other software and embedded in hardware, because fatness make it less ...
    (comp.lang.tcl)
  • Re: looking for tcl based Cisco like command line interface
    ... TinyTcl and Jim would be fine to save resources, but first is missing some newer tcl sub-/commands and later has no exec-command at all. ... Only want to install one single tcl/etcl/tclkit interpreter and a single tcl script. ... Funny, the cli can be run from any computer remote,using snmp get/get-next/set for communication to the network device, therefore got a remote console program too. ... extreme environments) based on ARM or Coldfire processor using Debian Linux/ucLinux should be extended with a CLI that is similar in behaviour, handling and naming conventions to the well known cisco command line interface (several user-visible application-specific commands, along with a help, different management operation levels like "enable", "config", line driven only, tab expansion, no special graphics or ascii terminal commands) ...
    (comp.lang.tcl)