Problems with adding my C commands to Tk... 
Author Message
 Problems with adding my C commands to Tk...

        Our version for Tcl is 7.3 and Tk is 3.6.  I used the
Tk_AppInit.c source that came with the distribution and added
the C commands as described in Welsh's draft.  Compiling was
fine but when I invoked my new tk shell, which I've called mywish, it
gave me this message:

        Tcl_AppInit failed: can't read "tk_library": no such variable

And I isolated the problem to within the Tcl_AppInit function where it
tries to invoke with:

    if (Tk_Init(interp) == TCL_ERROR) {
        return TCL_ERROR;

Apparently, Tk_Init returned the above error.  And when I did a "set
errorInfo" from inside mywish I got this:

        can't read "tk_library": no such variable
   while executing
"file exists $tk_library..."
    invoked from within
"if [file exists $tk_library..."

Later I tried setting the tk_library within my Tcl_AppInit function
with Tcl_SetVar, it gave me the same error but this time it was for
tk_version variable.  When I did the same to that variable, i.e.
Tcl_SetVar, I got the error:

        Tcl_AppInit failed: invalid command name "bind"

I've boggled. :( So, please drop me a line at

<< Yu-Ann >>

Mon, 06 Oct 1997 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Problem adding commands to a Tk interpreter.

2. TIP #96: Add [tk caret] Command and Tk_SetCaretPos API

3. How to add Tk commands

4. ANNOUNCE: Tk extension for adding canvas commands (on items)

5. a small Tk extension -- adding a command to define bitmap

6. Problem with adding a new TCL command

7. Info commands does not show extension added commands?

8. TK Problem: Adding a text label to a frame border

9. TK Problem: Adding label to frame border

10. to CS: or not to CS: in F-PC assembler

11. exec command problem in TCL/TK 8.3.2

12. problem creating new Tcl/Tk commands using C


Powered by phpBB® Forum Software