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