f



FAQ (unanswered): possible to use Tk without Tcl (in c/c++)

Googling turned up dozens of questions about using tk without tcl.  But 
there doesn't seem to be a clear answer.

Is it possible to use Tk without Tcl?

Specifically, I'd like to use Tk from c/c++ without using Tcl.  More 
specifically, I'd like to statically link in the Tk library and use it 
directly from c/c++.
0
nospam5705 (26)
8/2/2004 7:19:49 PM
comp.lang.tcl 23429 articles. 2 followers. Post Follow

8 Replies
598 Views

Similar Articles

[PageSpeed] 14

H. Simpson wrote:

> Googling turned up dozens of questions about using tk without tcl.  But 
> there doesn't seem to be a clear answer.
> 
> Is it possible to use Tk without Tcl?
> 
> Specifically, I'd like to use Tk from c/c++ without using Tcl.  More 
> specifically, I'd like to statically link in the Tk library and use it 
> directly from c/c++.

The Perl/Tk people did it. The Python/Tkinter people took the other 
route of embedding a Tcl interpreter along with it.

It is possible, but its wasting a lot of Tk's capabilities, that come 
from the Tcl language. A second problem is the Tk C-Api.

Do you have any special reasons to use Tk without Tcl?

Michael




0
schlenk (1615)
8/2/2004 7:35:31 PM
Michael Schlenker wrote:

> H. Simpson wrote:
> 
>> Googling turned up dozens of questions about using tk without tcl.  
>> But there doesn't seem to be a clear answer.
>>
>> Is it possible to use Tk without Tcl?
>>
>> Specifically, I'd like to use Tk from c/c++ without using Tcl.  More 
>> specifically, I'd like to statically link in the Tk library and use it 
>> directly from c/c++.
> 
> 
> The Perl/Tk people did it. The Python/Tkinter people took the other 
> route of embedding a Tcl interpreter along with it.
> 
> It is possible, but its wasting a lot of Tk's capabilities, that come 
> from the Tcl language. A second problem is the Tk C-Api.
> 
> Do you have any special reasons to use Tk without Tcl?
> 
> Michael
> 
> 
> 
> 

The c++ project I'm working on requires the distributables to be as 
small as possible.

And the security requirements make using a scripting language out of the 
question even if the scripts are embedded in a secure manner.

I was attracted to Tk because the size of the static lib was tiny 
compared to the other GUI toolkits.
0
nospam5705 (26)
8/2/2004 7:37:37 PM
As a previous answer indicated, the Perl integration to Tk bypasses Tcl.
and claims to support language independence for Tk. For details see:

http://www.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html


"H. Simpson" <nospam@asdlkfjhasldkjfsadlfhskadjfahsldfks.com> wrote in message
news:5KwPc.2288$hI.678962@newssvr28.news.prodigy.com...
> Michael Schlenker wrote:
>
> > H. Simpson wrote:
> >
> >> Googling turned up dozens of questions about using tk without tcl.
> >> But there doesn't seem to be a clear answer.
> >>
> >> Is it possible to use Tk without Tcl?
> >>
> >> Specifically, I'd like to use Tk from c/c++ without using Tcl.  More
> >> specifically, I'd like to statically link in the Tk library and use it
> >> directly from c/c++.
> >
> >
> > The Perl/Tk people did it. The Python/Tkinter people took the other
> > route of embedding a Tcl interpreter along with it.
> >
> > It is possible, but its wasting a lot of Tk's capabilities, that come
> > from the Tcl language. A second problem is the Tk C-Api.
> >
> > Do you have any special reasons to use Tk without Tcl?
> >
> > Michael
> >
> >
> >
> >
>
> The c++ project I'm working on requires the distributables to be as
> small as possible.
>
> And the security requirements make using a scripting language out of the
> question even if the scripts are embedded in a secure manner.
>
> I was attracted to Tk because the size of the static lib was tiny
> compared to the other GUI toolkits.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.729 / Virus Database: 484 - Release Date: 27/07/2004


0
stevebold (40)
8/2/2004 8:40:32 PM
According to H. Simpson <nospam@asdlkfjhasldkjfsadlfhskadjfahsldfks.com>:
:Googling turned up dozens of questions about using tk without tcl.  But 
:there doesn't seem to be a clear answer.
:
:Is it possible to use Tk without Tcl?
:
:Specifically, I'd like to use Tk from c/c++ without using Tcl.  More 
:specifically, I'd like to statically link in the Tk library and use it 
:directly from c/c++.

It appears that after refinement your question (mentioned later in the
thread) is:

Can I use Tk without the use of a script interpreter?

I don't know that anyone has tried it - because so much of Tk is
built around having an interpreter around.  
-- 
<URL: http://wiki.tcl.tk/ > In God we trust.
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvirden@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >
0
lvirden (1938)
8/3/2004 2:49:46 PM
Dnia Mon, 02 Aug 2004 19:37:37 GMT, H. Simpson skrobie:
> The c++ project I'm working on requires the distributables to be as 
> small as possible.

> And the security requirements make using a scripting language out of the 
> question even if the scripts are embedded in a secure manner.

> I was attracted to Tk because the size of the static lib was tiny 
> compared to the other GUI toolkits.

What a platform do you use (or you want a multiplaform kit)? Which libraries
did you compare it with?


-- 
//  _    ___         Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl>
\\ L_ |/ `|  /^\ ,()                         <ethourhs(O)wp.pl>
// \_ |\  \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx
0
8/4/2004 6:52:33 PM
H. Simpson wrote:
> The c++ project I'm working on requires the distributables to be as 
> small as possible.
> 
> And the security requirements make using a scripting language out of the 
> question even if the scripts are embedded in a secure manner.

You're using C++ and have serious security requirements? That's very...
brave of you...

> I was attracted to Tk because the size of the static lib was tiny 
> compared to the other GUI toolkits.

Tk's small size comes from the fact that it can rely on having a
scripting language underneath it. Not that any of it needs to be exposed
to users; there are tools available for parcelling up everything nice
and tight out of harms way.

Donal.
0
8/6/2004 3:39:26 PM
H. Simpson wrote:
> Michael Schlenker wrote:
>> H. Simpson wrote:
>>
>>> Googling turned up dozens of questions about using tk without tcl.  
>>> But there doesn't seem to be a clear answer.
>>>
>>> Is it possible to use Tk without Tcl?
>>>
>>> Specifically, I'd like to use Tk from c/c++ without using Tcl.  More 
>>> specifically, I'd like to statically link in the Tk library and use 
>>> it directly from c/c++.
>>
>> The Perl/Tk people did it. The Python/Tkinter people took the other 
>> route of embedding a Tcl interpreter along with it.
>>
>> It is possible, but its wasting a lot of Tk's capabilities, that come 
>> from the Tcl language. A second problem is the Tk C-Api.

FWIW, a rewrite of Perl/Tk that actually reintroduces Tcl uses
less memory and is faster than Perl/Tk with Tcl removed.

>> Do you have any special reasons to use Tk without Tcl?
> 
> The c++ project I'm working on requires the distributables to be as 
> small as possible.

What exactly are you targetting?  2MB?  10MB?

> And the security requirements make using a scripting language out of the 
> question even if the scripts are embedded in a secure manner.

You can easily lock down Tcl for secure environments.  Can you
elaborate on the exact requirements?

-- 
     Jeff Hobbs, The Tcl Guy
     http://www.ActiveState.com/, a division of Sophos
0
jeffh1 (361)
8/9/2004 5:11:08 AM
In article <noWdnWWjx_3xmorcRVn-tA@novus-tele.net>,
Jeff Hobbs  <jeffh@removethis.activestate.com> wrote:
>H. Simpson wrote:
			.
			.
			.
>> The c++ project I'm working on requires the distributables to be as 
>> small as possible.
>
>What exactly are you targetting?  2MB?  10MB?
>
>> And the security requirements make using a scripting language out of the 
>> question even if the scripts are embedded in a secure manner.
>
>You can easily lock down Tcl for secure environments.  Can you
>elaborate on the exact requirements?
			.
			.
			.
I guess we should say this in an affirmative way:  whatever
your true security requirements, it's likely that Tcl pro-
vides BETTER facilities for "lock-down" than C++.  If there's
a syllogism that

  Scorned (sometimes spelled, "scripting") languages can't be used.
  Tcl is a scorned language.

then you'll have to explain the original question again.

If it helps, I am and have been involved in projects that must
be done in C, and we do our development in Tcl.  For the pur-
pose of these restrictions, we simply declare, truthfully, 
that Tcl is a C library.
0
claird (2363)
8/9/2004 12:08:04 PM
Reply:

Similar Artilces:

Using Tcl/Tk 8.4.7 from C/C++
Hi, I just discovered Tcl/Tk and fairly excited about it :) I'm interested in using both Tcl/Tk on one c++ project and only Tk on another c++ project. 1. C++ Tk only project: I'm interested in using Tk within my c/c++ project. The project only has 5-6 dialogs using just the standard widgets. Is it fairly common to use Tk directly from c/c++--and is it fairly easy? 2. C++ Tcl/Tk only project: I'm interested in using both Tcl and Tk from within a c/c++ application. Is maketclapp the best way to go or are there better ways? Maketclapp doesn't seem to have been updated in a while...but the security features (hiding tcl source) is compelling for this particular project. Thanks. ...

TCL/TCL combined with Java/C/C++, Any Recommendations?
Hi, I have an application that I wrote in TCL/TK. It has to work with big files +5GB. The parsing performace is not where I would like and some of the data manipulations are taking considerable amount of time due to the data size. Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time. I am trying to figure out which language will be easier to merge with TCL in an application. For C I know that I can compile and generate a .so or .dll and create a TCL package and load it. I believe this is done with SWIG but I have not done it. In Java I saw some info on Jacl and TclBlend. The application will be "compiled" into a TCL "executable". I know I can compile my TCL code into Byte code to protect the IP. I am not sure about Java. Any recommendations or pointers will be greatly appreciated. Thanks in advance, Frank Frank <kranfg@gmail.com> writes: > Hi, > > I have an application that I wrote in TCL/TK. It has to work with big files +5GB. > > The parsing performace is not where I would like and some of the data manipulations are taking considerable amount of time due to the data size. > > Therefore I am considering switching these parts of the code to Java, C or C++. While keepting the GUI and GUI supporting code in TCL/TK at this time. > > I am trying to figure out which language will be easier to ...

Tcl to C or C++
Hi all, does anyone know some tool (free or not) capable to translate Tcl source code to C or C++? Of course I believe to translate only a subset of Tcl language (1), while statements like this: #...some code that algorithmically generate the string a, where a is # almost-arbitrary code eval $a cannot be translated at all, except with somewhat complex solutions! Thank you (1) I'm thinking to traslate Tcl source code written using a subset of Tcl keywords and by following some coding rules; for example I'd avoid this: #...some code that calculates a and b set $a$b 0 Stefano Chiappa Dear Stefano, Is there a reason for wanting this convertion? As I have tried to do such a project in the past, it turned out that the resulting C code was much more slower & memory wasting than the corrsponing tcl code, so I gave up :-) So, for such a tool a severe investment on optimisations has to be made, in order for the generated C code to be of use. I remember that there was at least one such commercial compiler in the past, but I don't know if it is still active. See for example: http://groups.google.com.gr/groups?q=aotto+compiler&hl=el&lr=&group=comp.lang.tcl.*&selm=pgpmoose.200101222138.11399%40non.non.net&rnum=1 I remember that I had tested the compiler and indeed it gave some speedup over the tclc code. However, I believe the speedup was due to the heavy optimisation that was done by the author, and not from the fact that it was converted i...

Is it possible to use TCL OO C API without calling Tcl_main or dealing with stubs?
I've been trying to use TCL OO C API interface with no much success in the = last days. In particular, it seems not to be possible to use it without usi= ng stubs and it doesn't seem possible to use stubs without calling Tcl_main= (which is not an option in my case since I need to control the interpreter= in a different way).=20 Is there a way to use TCL OO C API without using TCL stubs? If not, can I initialize the stubs ptr without handing control of my applic= ation to tcl through Tcl_main? Thanks, Lucio On 18/08/2015 23:07, luciorech@gmail.com wrote: > I'...

following tcl command execution from C/C++ code to tcl in gdb
Hi, We have a C/C++ huge application that makes heavy use of tcl C bindings. We frequently have very long stack traces from within gdb/dbx that look like this: #7 0x0d0aac7d in TclObjInterpProc (clientData=0x12857160, interp=0x10924df8, objc=6, objv=0x15138a40) at ../generic/tclProc.c:1146 #8 0x0d043dc6 in TclEvalObjvInternal (interp=0x10924df8, objc=6, objv=0x15138a40, command=0xe0c1382 "", length=0, flags=262144) at ../generic/tclBasic.c:3087 #9 0x0d044045 in Tcl_EvalObjv (interp=0x10924df8, objc=6, objv=0x15138a40, flags=262144) at ../generic/tclBasic.c:3203 This is just a very small part of what can be a very long stack trace. Now by poking around I can see that in gdb I can print *objv[0] to see the first word of a command but this is painful. What we really want is a way to see what Tcl commands are being executed either while the program is running or easily from the stack trace. Can you run gdb as well as a Tcl debugger at the same time? Seems unlikely. How are people systematically tracing the execution of Tcl commands that are called from C/++ bindings? Thanks. foobarbaz99@hotmail.com wrote: > How are people systematically tracing the execution of Tcl commands > that are called from C/++ bindings? Are you familiar with Tcl_CreateObjTrace() ? Does it accomplish what you need? -- | Don Porter Mathematical and Computational Sciences Division | | donald.porter@nist.gov Information Technology Laboratory | | http://mat...

Writing new tcl command using c or c++?
Can anyone help me to write new command that can be used in tcl shell using c or c++ code. Himanshu Gupta <himanshulkce@gmail.com> wrote: > Can anyone help me to write new command that can be used in tcl shell > using c or c++ code. Start here: http://wiki.tcl.tk/9849 and here: http://wiki.tcl.tk/21007, read these and then follow and read the links to the other pages from the above two. On Monday, 5 January 2015 14:12:44 UTC+5:30, Himanshu Gupta wrote: > Can anyone help me to write new command that can be used in tcl shell using c or c++ code. Thankyou... On M...

In Tcl and C++ code, how to use Tcl Command, such as exit?
In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control all input and output from Tcl, but i want to use some of Tcl' Commands, such as, exit. I used Tcl_Eval() then, but the Tcl command seem invisible in my code, I typed a string in command prompt, such as "AAAAA", and Enter, got nothing feedback. How can i do to get these Tcl Commands work? Thanx! vian1381@china.com.cn wrote: > In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control > all input and output from Tcl, but i want to use some of Tcl' Commands, > such as, exit. > > I used Tcl_Eval() then, but the Tcl command seem invisible in my code, > I typed a string in command prompt, such as "AAAAA", and Enter, got > nothing feedback. Your questions are hard to understand, but they suggest that you believe that setting a custom stdin channel will do some magic to establsh a prompt/read/eval loop. That is not the case. > How can i do to get these Tcl Commands work? Start with something that works, like the source code for tclsh, and adapt to your needs. Or post a followup and include more code examples to explain what you're doing and how it doesn't do what you expect. -- | Don Porter Mathematical and Computational Sciences Division | | donald.porter@nist.gov Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |_____________________________________...

Wrap tcl/tk script with a C/C++ dll for windows
My company has a software tool that consists of a command-line driven shell that can load extension .dll files. I'd like to add a tk gui to my extension dll file. I am currently looking into freewrap: http://freewrap.sourceforge.net/ and mktclapp: www.hwaci.com/sw/mktclapp/mktclapp.html But I figured I might get more experienced information (and possibly quicker answers) here. Example of use (in the windows command line box): C:\MasterShell>mastershell MasterShell V 3.14159 > load newtkgui (at this point it loads newtkgui.dll) > Either the gui takes over completely (probably easier), or the shell or the gui can both enter commands. The main point is, I don't want to recast mastershell as a slave to a tk gui (using expect, for instance), although that's a possibility. I've been doing some experiments with it and I keep getting socket disconnects when I run wish or tclsh from the "mastershell" though that's probably a mastershell problem. Thanks, Rufus In article <1102002088.XDKV9OF4B2AClpOoX63anw@teranews>, Rufus V. Smith <nospam@nospam.com> wrote: >My company has a software tool that consists of a command-line driven shell >that can load extension .dll files. > >I'd like to add a tk gui to my extension dll file. > >I am currently looking into freewrap: http://freewrap.sourceforge.net/ > >and mktclapp: www.hwaci.com/sw/mktclapp/mktclapp.html > >But I figured I might get m...

C++/Tcl/C++ Interface
Hi, I'm a newbie in Tcl and Tcl/C++ interfacing. I need to develop a prototype for one of our upcoming project. I've a shared library which provides Tcl procedures to traverse through some graph which is being created upon reading a file of specific format. If I load this shared library in Tcl shell and call those proc to read the specific file and traverse the graph. Graph traversal proc are like: * getting neighbor nodes of a given node * getting the node name and edge names to/from a node Let's name this Tcl library GL (graph lib). Now, in my C++ program I need create a duplicate graph since I don't have capability read that file directly. So from my C++ code, I need to create a Tcl channel, send commands through the Tcl channel for GL procs and get information from those GL procs to my C++ application to build a duplicate graph on my end. Could some one provide hints how to go about this? Any pointers to existing resource (doc/open source code) will be very helpful. Please redirect me to correct group if this is not the most appropriate one. Regards, ~ Soumen Soumen wrote: > Hi, > > I'm a newbie in Tcl and Tcl/C++ interfacing. I need to develop a > prototype for one > of our upcoming project. > > I've a shared library which provides Tcl procedures to traverse > through some graph > which is being created upon reading a file of specific format. If I > load this shared > library in Tcl shell and ca...

adding events to tcl queue, or using variables and traces (C and TCL)
I'm writing simple testing framework for embedded application. The application is written on C language and runs on microchip PIC microcontroller normally. To test application I made the following: * hardware depended code was picked out from main source and written to separate source files (module_hal.c for example); * two build mode for program: for microchip PIC, using *_hal.c files dealing with real hardware, or for PC, where *_hal.c files contain hardware simulation code and bindings to TCL-commands. Then program was build for PC, I can using TCL commands change input signal states for simulated hardware, for example, or view output signal states. But I need some method to call tcl callback procedure when output signal changes state. I see two methods to achieve this: * map signal state to variable, and then use 'trace' command to bind tcl-scripts to state change events; * add new events to tcl event queue, as described here: http://wiki.tcl.tk/17195 Which method can be more preferable and why? In case if signal state changes too fast, and if I use variable trace, my callback will be called on every state change -- I think it is serious drawback of first method. With second method I can add only one event to queue, and add second only if first event is processed. But as I see, second method requires more complex code in C (now I wrote this code and see it as serious drawback too). May be exists some other methods to call tcl-callbacks on even...

about using tclapp wrap tcl/tk and c problem
Hi, all I know there are two methods to develop program using tcl/tk and c, the first method is by calling Tcl_Main, Tcl_AppInit to customize the main program and include tcl scripts; the other method is to make c library and then load the library in tcl script. Is there any method to use tclapp wrap the program developed by the first method? Could you tell me how to do this? now, I make my c program to a libmylib.so, and my tcl script will load it. libmylib.so depends on some other library, such as libtcl84.so and libtk84.so. now I wrap my tcl script and libmylib.so to a starpack. Tclapp will add base tcl runtime envirnment automatically, but, the libmylib.so depends on libtcl84.so and libtk84.so, need I add and wrap these library repeatedly? Is there any method to wrap my program but reduce the size of starpack? Best Regards! Tony O/H sunnyboyGuo@gmail.com έγραψε: > Hi, all > I know there are two methods to develop program using tcl/tk and c, the > first method is by calling Tcl_Main, Tcl_AppInit to customize the main > program and include tcl scripts; the other method is to make c library > and then load the library in tcl script. > Is there any method to use tclapp wrap the program developed by the > first method? Could you tell me how to do this? > > now, I make my c program to a libmylib.so, and my tcl script will load > it. libmylib.so depends on some other library, such as libtcl84.so and > libtk84.so. now I wrap my tcl script ...

Using Tcl/Tk as a user interface in a C program
Hi, i thought this question would come up every day, but i read this NG for a while and haven't seen it since. What i'd like to do is use Tcl/Tk in a standalone (linked against Tcl and/or Tk libs) C program. I'd like to open Windows and call Tcl scripts from C that handle the windows. I wouldn't like to have external scripts called, but i'd like to embed it in the C program. Has anybody got a short example for that (Linux / Windows)? Thanks for any hints, Torsten. MkTclApp is your friend: http://www.hwaci.com/sw/mktclapp/index.html Pretty simple, really. On Tue, 18 Nov 2003, Torsten Mohr wrote: > Date: Tue, 18 Nov 2003 20:05:35 +0100 > From: Torsten Mohr <tmohr@s.netic.de> > Newsgroups: comp.lang.tcl > Subject: Using Tcl/Tk as a user interface in a C program > > Hi, > > i thought this question would come up every day, but i read this > NG for a while and haven't seen it since. > > What i'd like to do is use Tcl/Tk in a standalone (linked against > Tcl and/or Tk libs) C program. > > I'd like to open Windows and call Tcl scripts from C that handle > the windows. I wouldn't like to have external scripts called, but > i'd like to embed it in the C program. > > Has anybody got a short example for that (Linux / Windows)? > > > Thanks for any hints, > Torsten. > > * Torsten Mohr <tmohr@s.netic.de> | I'd like to open Windows and call Tcl sc...

Use TCL/TK to directly display c-generated jpg?
I have a C program that captures composite video images, converts them to jpg images, and stores the jpg images in files for later display. Is there any way for the C program, using TCL/TK, to display directly the jpg images without the overhead of saving the images in files? (Needless to say I am running in X-Windows, but the C program currently runs as a console app). Thanks, Dave Feustel dave wrote: > I have a C program that captures composite video images, converts them > to jpg images, and stores the jpg images in files for later display. > > Is there any way for the C program, using TCL/TK, to display directly > the jpg images without the overhead of saving the images in files? Look at [image create photo myimagename -data $imagedata ...] HTH, Gerry ...

Better C/C++ Than C/C++?
I am looking for a good systems programming language that can be used instead of C/C++. My qualifications for the language are: * mature compiler(s) that produce native-code binaries (for Windows) * open source - preferable, but not 100% necessary Thanks, Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) Ocaml, D, cyclone, Eiffel, Beta > * open source - preferable, but not 100% necessary what's wrong with using C? Friedrich > what's wrong with using C? Too low level, no built-in garbage collection. -- Kevin "Kevin Albrecht" <kevin@albrecht.net> writes: >> what's wrong with using C? > > Too low level, Well the Smalltalk people say, have a small language and a big library. I assume C's library status beyond that of Smalltalk. > no built-in garbage collection. Use the Boehm Weisser GC. Friedrich "Kevin Albrecht" <kevin@albrecht.net> wrote in message news:<2TiYb.237892$rj7.1641209@twister.tampabay.rr.com>... > I am looking for a good systems programming language > that can be used instead of C/C++. My qualifications > for the language are: > > * mature compiler(s) that produce native-code > binaries (for Windows) > ...

Urgent: looking for software test developer with C/C++ & Tcl/Tk experience in Seattle
Hello fellow Tcl'ers, this posting is somewhat off topic, I have recieved the following contract opportunity in the Seattle area and I am unable to fulfill it myself. Please contact me if interested, here is the information: Contract for tester of Linux O/S and S/W with C/C++ & Tcl/Tk Contract Position: Tester Length of Contract: 4-6 months Location: Seattle, WA Other requirements: US Citizenship required Responsibilities include: system software test planning and test specification porting and executing existing test software developing and executing new test software test results tracking test automation reporting and reproducing system software failsures regression testing contributing to overall software development and release goals prioritizing and strategizing for optimal testing effectiveness Requirements: 3-5 years experience testing Linux O/S and software. Experience with CVS or other configuration management tools. Working knowledge of C or C++ Working knowledge of Tcl Best Regards, Anthony ...

l'C program executing from a tcl script with pipe opened using open command in Tcl
Hi all, I wanted to communicate with a C program from a Tcl script.. The test code i have written is below Both the 'C' program and Tcl script are located in the same directory. The 'C' program is below. I have named it CTCL.C #include<stdio.h> #include<string.h> int main() { int i; char c[30]; printf("Reading..."); scanf("%s",c); printf("String read is :%s\n",c); fflush(stdout); return 0; } I have compiled the program with the command cc CTCL.C -o ctcl So the executable was generated with the name 'ctcl' The Tcl script I have written is. I have named it TCLPIPETEST.tcl #!/usr/add-on/exptools/bin/tclsh set fd [open "|./ctcl" r+] gets $fd tmp1 puts "tmp1 = $tmp1" set stat 0 set tmp2 "Default value... " if { ![catch { puts $fd "abcdef" } res]} { if { ![catch { flush $fd } res] } { if { ![catch { gets $fd tmp2} res ] } { set stat 1 } else { puts "Error 'gets' from pipe : $res" } } else { puts "Error 'flush' from pipe:$res " } } else { puts "Error 'puts' from pipe:$res " } if { $stat == 1 } { puts "Success......:$tmp2 :)" } else { puts "Failure......:$tmp2 :(" } I have given all permissions for both the files above. When i execute the Tcl script My aim is to open a pipe with the 'C' executable 'ctcl', initially read so...

C + Tcl/Tk
I'm a newbie of Tcl language and I would like to know how I could create a GUI in Tcl/Tk for a console program written in C, 'cause I'd like to write a platform indipendent Graphical application. I found out some helps from the "Load" page of ActiveTcl help on-line. Do you know further sites/references where I can find some stuff and help? Thanks in andvance for your replies. ffgg2005@tiscali.it wrote: > I'm a newbie of Tcl language and I would like to know how I could > create a GUI in Tcl/Tk for a console program written in C, 'cause I'd > like to write a platform indipendent Graphical application. > I found out some helps from the "Load" page of ActiveTcl help on-line. > Do you know further sites/references where I can find some stuff and > help? Hi, What exactly are you trying to do? Do you want to integrate Tcl with the program at the C level, or just make a "wrapper"? BTW, there is a tcl-italian mailing list, if you are interested - search for "tcl-italian" on google. Ciao, -- David N. Welton - http://www.dedasys.com/davidw/ Apache, Linux, Tcl Consulting - http://www.dedasys.com/ David N. Welton ha scritto: > ffgg2005@tiscali.it wrote: > > I'm a newbie of Tcl language and I would like to know how I could > > create a GUI in Tcl/Tk for a console program written in C, 'cause I'd > > like to write a platform indipendent Graphical application. > &...

Tcl/Tk from C
I want to write applications in C and create graphics/widgets/etc using Tcl/Tk library. I have no interest in programming Tcl/Tk except what is essential. Is there anywhere just one complete example of a C program that creates, say, a window containing a widget then obtaining input from that? Then I can work from that. At present I have an example that only creates an empty window, plus a huge amount of docs that tell me everything except how it all fits together. Thanks, Bart Bart C wrote: [...] If using C++ for your application isn't problem, then C++/Tk seems to be best choice: http://cpptk.sourceforge.net/ Else... I've no idea :) -- Pozdrawiam (Greetings)! Googie ...

Tcl/TK and C
Hi all, I've previously attempted to write a game-type application that consists mostly of a bunch of pieces the user can move with a mouse. I should mention here that I'm from a hardware background, and not super experienced with PC applications. My first attempt was purely in C++, using MFC with Visual Studio. I managed to make something somewhat functional, but in the end the complexity of the whole thing got the better of me, and I grew bored with the project. Recently, I've picked up Tcl/Tk, and it seems that the whole Tk toolkit is an excellent way to reduce the complexity I was running into (the canvas widget automates everything I struggled for weeks to figure out). On the downside, I still want some of the extra power of C/C++, especially pointers and more complicated data structures. I'm vaguely familiar with the process of extending Tcl/Tk by writing a function in C, and calling it from Tcl. What I'd like is to be able to use Tk only as a GUI, and retain all the data structures and computations behind the scenes in C. Is there a way to hold all your data in C structures, and share that data with the Tk GUI? One thing I had from Visual Studio was a project using the Document/View architecture. If I could implement the View in Tk, but keep the Document in C, I think I'd be on track. I know this is a very broad and somewhat vague question (reflecting my level of experience). If anyone can point me in the right direction, eit...

Using TCL with C#
I am trying to call TCL from my C# application and found some useful help on the Wiki website http://wiki.tcl.tk/9563 (as shown below). using System.Runtime.InteropServices; using System; namespace TclWrap { public class TclAPI { [DllImport("tcl84.DLL")] public static extern IntPtr Tcl_CreateInterp(); [DllImport("tcl84.Dll")] public static extern int Tcl_Eval(IntPtr interp,string skript); [DllImport("tcl84.Dll")] public static extern IntPtr Tcl_GetObjResult(IntPtr interp); [DllImport("tcl84.Dll")] public static extern string Tcl_GetStringFromObj(IntPtr tclObj,IntPtr length); } public class TclInterpreter { private IntPtr interp; public TclInterpreter() { interp = TclAPI.Tcl_CreateInterp(); if (interp == IntPtr.Zero) { throw new SystemException("can not initialize Tcl interpreter"); } } public int evalScript(string script) { return TclAPI.Tcl_Eval(interp,script); } public string Result { get { IntPtr obj = TclAPI.Tcl_GetObjResult(interp); if (obj == IntPtr.Zero) { return ""; } else { return TclAPI.Tcl_GetStringFromObj(obj,IntPtr.Zero); } } } } } However, when I use the Tcl_Eval command and pass the TCL command "source script1.tcl" or "file exists script1.tcl" (or any of the other file command), it causes an exception in my C# application. It works fine when you pass TCL commands ...

Extending TCL in C with tcl.h - Disabliing [<tcl-cmd>] feature
Hi, TCL has a command execution syntax like this: [<tcl cmd>] Anything inside the 3rd bracket will be executed as a Tcl command by the Tcl interprater. Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? In other words, my Tcl interprator should print "[32]" for tcl command puts "[32]" It should not try to treat [] as a special character. Is this any way possible while extending Tcl in C with tcl.h? Thank you, Arijit * arijit79@gmail.com | puts "[32]" | | It should not try to treat [] as a special character. Check out the TCL quoting rules. http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M10 http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M15 Any of puts {[32]} puts "\[32\]" will do the trick. R' On May 8, 3:14 am, ariji...@gmail.com wrote: > Is there any way I can disable/delete this Tcl construct [ <tcl-cmd>]? By doing this, you would disable the primary functionality of Tcl. I'm certain you could go into the tcl source and stop it - but why not talk about what you are really trying to do. Perhaps someone can give you a better way of doing what you are wanting to do. ...

Accessing array in C/C++ from TCL
Hi, I have written a TCL command in a C++ DLL. Now I would like to pass an array to this c++ command as follows. set f_array(0) "1 2 3 4" comand_name f_array(0) I used Tcl_GetByteArrayFromObj without much success. I was able to retrieve the information if I pass a list instead of array as follows. Tcl_ListObjGetElements(pInterp, argv[1], &listsize, &_datalist_obj); for (int i = 0; i < listsize; ++i) { double test; Tcl_GetDoubleFromObj(pInterp, _datalist_obj[i], &test)); } Can you help me in knowing how to get the information if I pass an array? TIA Joe * "Joe" <divya_krs@yahoo.com> | Now I would like to pass an array to this c++ command as follows. | | set f_array(0) "1 2 3 4" | comand_name f_array(0) Do you mean comand_name $f_array(0) here (note the "$")? | I was able to retrieve the information if I pass a list instead of | array as follows. I don't see an array in the above code, just one array element. Even if you indeed pass the variable _name_ instead of its value, it still is just one array element, not a whole array. In that case you would use Tcl_ObjGetVar2 (or Tcl_GetVar in string-based command interfaces) to get the single value of the array element. If you intend to get at the individual integers 1 2 3 4 in your example, you most probably have a list (which you already found out how to deal with). R' I'm not clear on what you are intending to do with the example. I...

C++ code with C-style interface for a library to be used in C++ and C?
Hi! I have a question about building and then using libraries containing C++ code. Let's say I have some C++ code and a .cpp file with 1 function that uses some other C++ code / classes etc... Also, any possible exception is handled within the function itself. In code: MyModule.h ---------- #ifndef MYMODULE_H #define MYMODULE_H extern int Test(float inParam1,float inParam2,float* outResult); #endif // #ifndef MYMODULE_H MyModule.cpp ------------ #include "MyModule.h" #include "MyClasses.h" // contains MyClassA and MyClassB int Test(float inParam1,float inParam2,...

How to use Tcl for c code testing using VxWorks
This is Harika. I would like to know how to use tcl in c for testing, in VxWorks operating system. If possible give me example. I have written for unit level testing but iam getting error saying that interep is not found. But i have to do for automation absolutely. Let me know does Expect is necessary for automation. I didn't get Explore Expect book in chennai.I would be so thank full if any one do favour for me. Awaiting for the reply, Thanking you. In article <1176120872.799611.271860@d57g2000hsg.googlegroups.com>, Harika <harika.it@gmail.com> wrote: >This is Harika. I would like to know how to use tcl in c for testing, >in VxWorks operating system. If possible give me example. I have >written for unit level testing but iam getting error saying that >interep is not found. But i have to do for automation absolutely. Let >me know does Expect is necessary for automation. I didn't get Explore >Expect book in chennai.I would be so thank full if any one do favour >for me. . . . Tcl is quite handy for testing <URL: http://wiki.tcl.tk/testing >. While Expect is widely used in testing, and has been very successful in that role, it is not necessary, as the URL above will explain. For unit testing of the sort you seem to be targetting, SWIG <URL: http://wiki.tcl.tk/swig > might be helpful. ...

Web resources about - FAQ (unanswered): possible to use Tk without Tcl (in c/c++) - comp.lang.tcl

Facebook Users Seeing Unanswered Friend Requests In Notifications Area Of News Feed
Some Facebook users are seeing friend requests that they have not yet responded to appear in the notifications area of their News Feeds , right ...

Reputation Bounty for Unanswered Questions
You’ll see the “start a bounty” link at the bottom of the question. Clicking on it expands the bounty panel. Use the slider to establish a reputation ...

Reality Check: Unanswered Questions About Colorado Theater Massacre - YouTube
Ben Swann Reality Check takes a look at the questions the national media isn't bothering to ask about the Colorado theater massacre.

Mers coronavirus is still posing myriad of unanswered questions for scientists
The Mers coronavirus continues to confound scientists. To better understand the disease and determine where it comes from, a new project set ...

Unanswered questions about siege gunman
As the nation comes to grips with the fatal Sydney siege, there are still many unanswered questions about why the gunman was on bail and not ...

Endless wait as calls go unanswered
"We just don't take new patients. We. Don't. Take. Them," the voice snapped down the line.

As storm clouds close in, Qantas' distress calls go unanswered
Alan Joyce is desperate to convince the government that the Flying Kangaroo needs help. But he may have cried wolf once too often, with the PM ...

MH370 victim’s wife Danica Weeks haunted by unanswered questions - PerthNow Search Search
DANICA Weeks says the discovery of wreckage from MH370 has brought her “no closure”, 17 months after the aircraft carrying her husband vanished. ...

Inquiry into the death of Lieutenant Marcus Case leaves unanswered questions over chopper crash
An overdue report on the inquiry into the death of Lieutenant Marcus Case, in a Chinook helicopter crash Afghanistan in 2011, has left the young ...

Centrelink leaves 26 million calls unanswered
... in 2013-2014, before simply giving up and hanging up. Nearly a quarter of the 57 million phone calls made to Centrelink last year went unanswered, ...

Resources last updated: 3/13/2016 7:15:21 PM