~ubuntu-branches/ubuntu/natty/perl-tk/natty

« back to all changes in this revision

Viewing changes to Tk/ErrorDialog.pm

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Zander
  • Date: 2004-03-14 13:54:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314135444-prc09u2or4dbr3to
Tags: 1:800.025-2
Add xlibs-dev to Build-Depends:,
Closes: #237942

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
package Tk::ErrorDialog;
2
2
 
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 $
5
5
 
6
 
use English;
7
6
use Tk ();
8
7
require Tk::Dialog;
9
8
use base qw(Tk::Toplevel);
10
9
 
11
10
 
12
 
# ErrorDialog - a translation of `tkerror' from Tcl/Tk to TkPerl.
 
11
# ErrorDialog - a translation of bgerror() from Tcl/Tk to Perl/Tk.
13
12
#
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.
17
 
#
18
 
# Stephen O. Lidie, Lehigh University Computing Center.  95/03/02
19
 
# lusol@Lehigh.EDU
20
 
#
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.
26
 
#
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.
31
 
#
32
 
# Because an ErrorDialog object is a Frame widget all the composite base
33
 
# class methods are available to you.
34
 
#
35
 
# Advertised widgets:  error_dialog, text.
36
 
#
37
 
# 1) Call the constructor to create the ErrorDialog object, which in turn
38
 
#    returns a blessed reference to the new object:
39
 
#
40
 
#    require Tk::ErrorDialog;
41
 
#
42
 
#    $ED = $mw->ErrorDialog(
43
 
#        -cleanupcode     => $code,
44
 
#        -appendtraceback => $bool,
45
 
#    );
46
 
#
47
 
#       mw -   a window reference, usually the result of a MainWindow->new
48
 
#              call.
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).
53
 
#
54
16
 
55
17
use strict;
56
18
 
119
81
    $cw->ConfigSpecs(-cleanupcode => [PASSIVE => undef, undef, undef],
120
82
                     -appendtraceback => [ PASSIVE => undef, undef, 1 ]);
121
83
    $ED_OBJECT = $cw;
 
84
    $cw->protocol('WM_DELETE_WINDOW' => sub {$cw->withdraw});
122
85
    return $cw;
123
86
 
124
 
} # end new, ErrorDialog constructor
125
 
 
 
87
} # end Populate
126
88
 
127
89
sub Tk::Error {
128
90
 
160
122
 
161
123
} # end Tk::Error
162
124
 
163
 
 
164
125
1;