From 904fd0757fe037dbfbf156b31f72e5ff5c7cd796 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 1 Mar 2010 01:54:19 +0000 Subject: commit more files of the tlperl.straw dir, still not complete git-svn-id: svn://tug.org/texlive/trunk@17244 c570f23f-e606-0410-a88d-b1316a301751 --- .../lib/auto/Tk/Widget/FindAltKeyTarget.al | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 Master/tlpkg/tlperl.straw/lib/auto/Tk/Widget/FindAltKeyTarget.al (limited to 'Master/tlpkg/tlperl.straw/lib/auto/Tk/Widget/FindAltKeyTarget.al') diff --git a/Master/tlpkg/tlperl.straw/lib/auto/Tk/Widget/FindAltKeyTarget.al b/Master/tlpkg/tlperl.straw/lib/auto/Tk/Widget/FindAltKeyTarget.al new file mode 100755 index 00000000000..c152adb0347 --- /dev/null +++ b/Master/tlpkg/tlperl.straw/lib/auto/Tk/Widget/FindAltKeyTarget.al @@ -0,0 +1,38 @@ +# NOTE: Derived from blib\lib\Tk\Widget.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Widget; + +#line 1642 "blib\lib\Tk\Widget.pm (autosplit into blib\lib\auto\Tk\Widget\FindAltKeyTarget.al)" +# ::tk::FindAltKeyTarget -- +# search recursively through the hierarchy of visible widgets +# to find button or label which has $char as underlined character +# +sub FindAltKeyTarget +{ + my ($w,$char) = @_; + $char = lc $char; + if ($w->isa('Tk::Button') || $w->isa('Tk::Label')) + { + if ($char eq lc substr($w->cget(-text), $w->cget(-underline), 1)) + { + return $w; + } + else + { + return undef; + } + } + else + { + for my $cw ($w->gridSlaves, $w->packSlaves, $w->placeSlaves) # Cannot handle $w->formSlaves here? + { + my $target = $cw->FindAltKeyTarget($char); + return $target if ($target); + } + } + undef; +} + +# end of Tk::Widget::FindAltKeyTarget +1; -- cgit v1.2.3