Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C function become a tcl Command

Status
Not open for further replies.

mistkhan

Technical User
May 31, 2003
14
0
0
IN
I wanted to write a C code which will program a flash. This should happen on selection of a button in a GUI. ie calling this flash C function from tcl/tk. For this should I have to create tcl command using tclCreateCommand , tclInterp... Like this I have lots of device program and application which is in C. For all these things should I have to create a tclCreateCommand. According to my understanding all the C function will become a tcl Command ?. Is this right.

Thanking you in advance
Regards
Aman
 
General speaking, yes. But I've got two ideas for you that might save you a lot of effort that you can explore more on the Tcl'ers Wiki (
If you've got existing C code -- or even a compiled library for which you have header files -- SWIG can automatically generate all the wrapper code you need to expose those C functions as Tcl commands. Highly recommended for situations like these. Check it out at
If you're writing the C code from scratch, you might consider using Critcl, which in essence allows you to embed C code directly in your Tcl scripts. Read more about it at
- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Don't understand why you want a C nightmare to flash a button.
It's easy to let Tcl & Tk do the job.
(maybe I don't understand what you want to do)

ulis
 
I suspect that Aman wants to progam a flash memory device, though I could be mistaken.

- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top