diff options
Diffstat (limited to 'Master/tlpkg/tlperl.straw/lib/auto/Tk/Widget/FindAltKeyTarget.al')
-rwxr-xr-x | Master/tlpkg/tlperl.straw/lib/auto/Tk/Widget/FindAltKeyTarget.al | 38 |
1 files changed, 38 insertions, 0 deletions
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; |