Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | # NOTE: Derived from blib/lib/Tk.pm. |
2 | # Changes made here will be lost when autosplit is run again. | |
3 | # See AutoSplit.pm. | |
4 | package Tk; | |
5 | ||
6 | #line 542 "blib/lib/Tk.pm (autosplit into blib/lib/auto/Tk/FocusOK.al)" | |
7 | sub FocusOK | |
8 | { | |
9 | my $w = shift; | |
10 | my $value; | |
11 | catch { $value = $w->cget('-takefocus') }; | |
12 | if (!$@ && defined($value)) | |
13 | { | |
14 | return 0 if ($value eq '0'); | |
15 | return $w->viewable if ($value eq '1'); | |
16 | $value = $w->$value(); | |
17 | return $value if (defined $value); | |
18 | } | |
19 | if (!$w->viewable) | |
20 | { | |
21 | return 0; | |
22 | } | |
23 | catch { $value = $w->cget('-state') } ; | |
24 | if (!$@ && defined($value) && $value eq 'disabled') | |
25 | { | |
26 | return 0; | |
27 | } | |
28 | $value = grep(/Key|Focus/,$w->Tk::bind(),$w->Tk::bind(ref($w))); | |
29 | return $value; | |
30 | } | |
31 | ||
32 | # end of Tk::FocusOK | |
33 | 1; |