home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / tcl / 2094 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  1.9 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!sprite.Berkeley.EDU!ouster
  2. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: Exiting tk Apps
  5. Date: 12 Dec 1992 00:18:49 GMT
  6. Organization: U.C. Berkeley Sprite Project
  7. Lines: 30
  8. Distribution: world
  9. Message-ID: <1gbb59INNlr3@agate.berkeley.edu>
  10. References: <1992Dec10.151958.5766@texhrc.uucp>
  11. NNTP-Posting-Host: tyranny.berkeley.edu
  12.  
  13. In article <1992Dec10.151958.5766@texhrc.uucp>, schendr@texhrc.uucp (Dan R. Schenck) writes:
  14. |> When exiting a tk application with the tcl exit command, the application is
  15. |> destroyed except a notion of it still hangs around as evidenced by doing a 
  16. |> winfo interps.  Example:
  17. |> 
  18. |>     1) application foo is exited with: exit 0
  19. |>     2) in wish I do a winfo interps and foo is still listed
  20. |>     3) if I try to send to foo I get this message: 
  21. |>         receiver never heard of interpreter "foo"
  22. |> 
  23. |> The question is, can I exit an application with a specified return code and not
  24. |> have it appear that the application is still there when another app does a
  25. |> winfo?  Now I have to send the app a message and catch any error just to see
  26. |> if it really exists.  The only alternative is to exit all tk applications
  27. |> with "destroy .", which means I can't exit with a return code.
  28. |> -- 
  29. |> +--------------- Dan R. Schenck - Data Management - TEXACO EPTD ---------------+
  30. |> |  External Email:  schendr@Texaco.COM        Texaco Email:  schendr@texhrc    |
  31. |> |    _   __         Voice:    (713) 954-6053  Fax:  (713) 954-6911             |
  32. |> |   /_) /-/ /\/     US Mail:  Texaco, Inc., 3901 Briarpark, Houston, TX 77042  |
  33.  
  34.  
  35. You need to use "destroy ." to clean up all of the application's state, such
  36. as removing its interpreter registration.  I haven't tried this, but I'll bet
  37. you can do
  38.  
  39. destroy .
  40. exit $value
  41.  
  42. to both clean up the window state and exit with a specific exit code.
  43.