gsd4me has asked for the wisdom of the Perl Monks concerning the following question:

Dear all,

I have recently bought the book "Mastering perl/Tk" by Lidie and Walsh and in it they reference the debug-helpful package Tk::bindDump but I cannot find it in either the CPAN or ppm repositories. Does anyone know where the package can be found?

Many thanks

ADB

Replies are listed 'Best First'.
Re: Tk::bindDump availability?
by Perlbotics (Archbishop) on Mar 26, 2018 at 18:43 UTC

    I've found it in Tk::Widget. So it should work when invoked on your object. If not, please post an example.

    Update: Minimal example:

    use Tk; use strict; use warnings; my $mw = MainWindow->new; $mw->Label(-text => 'Hello, world!')->pack; $mw->Button( -text => 'Quit', -command => sub { exit }, )->pack; my (@bindtags) = $mw->bindtags; print "\$mw's bindtags:\n", join("\n", @bindtags), "\n"; print "\nCORRECTION: NOW THE bindDump():\n", $mw->bindDump(); # <-- U +PDATE2 MainLoop;
    Output on STDOUT:
    mw's bindtags: MainWindow . all CORRECTION: NOW THE bindDump(): ## Binding information for '.', MainWindow=HASH(0xf20e08) ## 1. Binding tag 'MainWindow' has no bindings. 2. Binding tag '.' has no bindings. 3. Binding tag 'all' has these bindings: <Key-F10> : Tk::Callback=SCALAR(0xf57d08) + 'FirstMenu' <Alt-Key> : Tk::Callback=ARRAY(0xf57c48) + 'TraverseToMenu' Tk::Ev=SCALAR(0xcb3258) + : 'K' <<LeftTab>> : Tk::Callback=SCALAR(0xf57ba0) + 'focusPrev' <Key-Tab> : Tk::Callback=SCALAR(0xf57bb8) + 'focusNext'

    No use Tk::Widget; required. That is done automatically.

    Update2: Thanks to beech for pointing out that the real call to bindDump() was missing.