home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / doc / tkerror.n < prev    next >
Encoding:
Text File  |  1993-07-09  |  2.9 KB  |  71 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/tkerror.n,v 1.6 93/07/09 11:36:38 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS tkerror tk 7.0
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. tkerror \- Command invoked to process background errors
  29. .SH SYNOPSIS
  30. \fBtkerror \fImessage\fR
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. The \fBtkerror\fR command doesn't exist as built-in part of Tk.  Instead,
  36. individual applications or users can define a \fBtkerror\fR
  37. command (e.g. as a Tcl procedure) if they wish to handle background
  38. errors.
  39. .PP
  40. A background error is one that occurs in a command that didn't
  41. originate with the application.  For example, if an error occurs
  42. while executing a command specified with a \fBbind\fR of \fBafter\fR
  43. command, then it is a background error.  For a non-background error,
  44. the error can simply be returned up through nested Tcl command
  45. evaluations until it reaches the top-level code in the application;
  46. then the application can report the error in whatever way it
  47. wishes.  When a background error occurs, the unwinding ends in
  48. the Tk library and there is no obvious way for Tk to report
  49. the error.
  50. .PP
  51. When Tk detects a background error, it invokes the \fBtkerror\fR
  52. command, passing it the error message as its only argument.
  53. Tk assumes that the application has implemented the \fBtkerror\fR
  54. command, and that the command will report the error in a way that
  55. makes sense for the application.  Tk will ignore any result returned
  56. by the \fBtkerror\fR command.
  57. .PP
  58. If another Tcl error occurs within the \fBtkerror\fR command
  59. then Tk reports the error itself by writing a message
  60. to stderr.
  61. .PP
  62. .VS
  63. The Tk script library includes a default \fBtkerror\fR procedure
  64. that posts a dialog box containing the error message and offers
  65. the user a chance to see a stack trace that shows where the
  66. error occurred.
  67. .VE
  68.  
  69. .SH KEYWORDS
  70. background error, reporting
  71.