Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how do I call C/C++ functions from Tk scripts ???

0 views
Skip to first unread message

Stuart Maclean

unread,
Nov 8, 1994, 10:12:33 AM11/8/94
to
Hi there, I've read John Ousterhout's draft of his Tcl/Tk book and
nowhere in it can i find reference to calling C/C++ functions from Tk
scripts. I see that it is easy to do for Tcl scripts: just declare an
interpreter, crate some new commands for the interpreter, and call the
interpreter with a script file. I can't find an analogous procedure
for Tk scripts.

Basically I want to present the user with a form of, say, 20
parameters. I want to build this form with XF. Upon inputting a
parameter, I want to call a C/C++ function which posts the value to an
IPC message queue, for a separate process to deal with.

It does appear that I cannot do this. I have seen various postings
here (I only started reading this group today!) which suggest doing
the sort of thing I am trying to do, but without details.

Any help gratefully appreciated.

Confused, Stuart.


--
Stuart Maclean,
Dept of Electronics and Computer Science,
University of Southampton.

Michael Salmon

unread,
Nov 9, 1994, 3:51:06 AM11/9/94
to
In article <39o4h1$3...@louis.ecs.soton.ac.uk>

sdm...@ecs.soton.ac.uk (Stuart Maclean) writes:
|> Hi there, I've read John Ousterhout's draft of his Tcl/Tk book and
|> nowhere in it can i find reference to calling C/C++ functions from Tk
|> scripts. I see that it is easy to do for Tcl scripts: just declare an
|> interpreter, crate some new commands for the interpreter, and call the
|> interpreter with a script file. I can't find an analogous procedure
|> for Tk scripts.

I think that you have a big misconception about Tk. Tcl is an
extensible language that enables you to declare your own functions that
the interpretter then calls, Tk is a Tcl extension as are several
others, it doesn't change Tcl in anyway, it just adds functionality. So
the answer to your query is just everything that you have read about
Tcl applies to Tk, just be sure that you call both initialization
routines.

--

Michael Salmon

#include <standard.disclaimer>
#include <witty.saying>
#include <fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm

0 new messages