diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/auto/Tk/Listbox/SelectAll.al')
-rw-r--r-- | Master/tlpkg/tlperl/lib/auto/Tk/Listbox/SelectAll.al | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/auto/Tk/Listbox/SelectAll.al b/Master/tlpkg/tlperl/lib/auto/Tk/Listbox/SelectAll.al new file mode 100644 index 00000000000..50569afbe50 --- /dev/null +++ b/Master/tlpkg/tlperl/lib/auto/Tk/Listbox/SelectAll.al @@ -0,0 +1,32 @@ +# NOTE: Derived from ..\blib\lib\Tk\Listbox.pm. +# Changes made here will be lost when autosplit is run again. +# See AutoSplit.pm. +package Tk::Listbox; + +#line 838 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\SelectAll.al)" +# SelectAll +# +# This procedure is invoked to handle the "select all" operation. +# For single and browse mode, it just selects the active element. +# Otherwise it selects everything in the widget. +# +# Arguments: +# w - The listbox widget. +sub SelectAll +{ + my $w = shift; + my $mode = $w->cget('-selectmode'); + if ($mode eq 'single' || $mode eq 'browse') + { + $w->selectionClear(0,'end'); + $w->selectionSet('active') + } + else + { + $w->selectionSet(0,'end') + } + $w->eventGenerate("<<ListboxSelect>>"); +} + +# end of Tk::Listbox::SelectAll +1; |