home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / tcl / 2464 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.5 KB  |  40 lines

  1. Newsgroups: comp.lang.tcl
  2. Path: sparky!uunet!charon.amdahl.com!netcomsv!netcom.com!wongi
  3. From: wongi@netcom.com (Isaac Wong)
  4. Subject: Can a child use the inherited interp from its parent?
  5. Message-ID: <1993Jan23.001502.7262@netcom.com>
  6. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  7. Date: Sat, 23 Jan 1993 00:15:02 GMT
  8. Lines: 30
  9.  
  10. here's the situation: I have a user-defined tcl command using 
  11. Tcl_CreateCommand(), let's call it foo. foo needs to do something that takes
  12. a long time. So, in order not to have my Tk script hang there waiting for
  13. foo to get done. foo forks a child to do the task and the parent returns
  14. right away. when the child finishes, it sends a command to the interp to
  15. execute a proc in the user tk script (the proc name is supplied as one the foo 
  16. arguments) using 
  17.         Tcl_Eval(interp, "send ......", 0, (char **)NULL);
  18. So it's kinda like a call-back sequence. the problem is, as the child exits
  19. i get the following error:
  20.  
  21. X Error of failed request:  BadWindow (invalid Window parameter)
  22.   Major opcode of failed request:  2 (X_ChangeWindowAttributes)
  23.   Resource id in failed request:  0xa000b4
  24.   Serial number of failed request:  1832
  25.   Current serial number in output stream:  1250
  26.  
  27. I see the same thing on my Sparc at work and my Linux system at home. I am
  28. using tk3.0
  29.  
  30. Questions:
  31.     1) what exactly is the above error?
  32.  
  33.     2) is it legal/wise to have the child use the forked interp and
  34.         die with it as it exits?
  35.  
  36.     3) is there a better way to implement the call-back feature?
  37.  
  38. many thanks.
  39.  
  40.