1
1
package Tk::ErrorDialog;
3
3
use vars qw($VERSION);
4
$VERSION = '3.009'; # $Id: //depot/Tk8/Tk/ErrorDialog.pm#9 $
4
$VERSION = '3.011'; # $Id: //depot/Tk8/Tk/ErrorDialog.pm#11 $
9
8
use base qw(Tk::Toplevel);
12
# ErrorDialog - a translation of `tkerror' from Tcl/Tk to TkPerl.
11
# ErrorDialog - a translation of bgerror() from Tcl/Tk to Perl/Tk.
14
13
# Currently TkPerl background errors are sent to stdout/stderr; use this
15
14
# module if you want them in a window. You can also "roll your own" by
16
15
# supplying the routine Tk::Error.
18
# Stephen O. Lidie, Lehigh University Computing Center. 95/03/02
21
# This is an OO implementation of `tkerror', with a twist: since there is
22
# only one ErrorDialog object, you aren't required to invoke the constructor
23
# to create it; it will be created automatically when the first background
24
# error occurs. However, in order to configure the ErrorDialog object you
25
# must call the constructor and create it manually.
27
# The ErrorDialog object essentially consists of two subwidgets: an
28
# ErrorDialog widget to display the background error and a Text widget for the
29
# traceback information. If required, you can invoke the configure() method
30
# to change some characteristics of these subwidgets.
32
# Because an ErrorDialog object is a Frame widget all the composite base
33
# class methods are available to you.
35
# Advertised widgets: error_dialog, text.
37
# 1) Call the constructor to create the ErrorDialog object, which in turn
38
# returns a blessed reference to the new object:
40
# require Tk::ErrorDialog;
42
# $ED = $mw->ErrorDialog(
43
# -cleanupcode => $code,
44
# -appendtraceback => $bool,
47
# mw - a window reference, usually the result of a MainWindow->new
49
# code - a CODE reference if special post-background error processing
50
# is required (default is undefined).
51
# bool - a boolean indicating whether or not to append successive
52
# tracebacks (default is 1, do append).
119
81
$cw->ConfigSpecs(-cleanupcode => [PASSIVE => undef, undef, undef],
120
82
-appendtraceback => [ PASSIVE => undef, undef, 1 ]);
84
$cw->protocol('WM_DELETE_WINDOW' => sub {$cw->withdraw});
124
} # end new, ErrorDialog constructor