home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _7fad83faee51eefe368c963d494cbd24 < prev    next >
Encoding:
Text File  |  2004-06-01  |  1.1 KB  |  41 lines

  1. # NOTE: Derived from ..\blib\lib\Tk\Listbox.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Listbox;
  5.  
  6. #line 645 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\BeginToggle.al)"
  7. # BeginToggle --
  8. #
  9. # This procedure is typically invoked on control-button-1 presses. It
  10. # begins the process of toggling a selection in the listbox. Its
  11. # exact behavior depends on the selection mode currently in effect
  12. # for the listbox; see the Motif documentation for details.
  13. #
  14. # Arguments:
  15. # w - The listbox widget.
  16. # el - The element for the selection operation (typically the
  17. # one under the pointer). Must be in numerical form.
  18. sub BeginToggle
  19. {
  20.  my $w = shift;
  21.  my $el = shift;
  22.  if ($w->cget('-selectmode') eq 'extended')
  23.   {
  24.    @Selection = $w->curselection();
  25.    $Prev = $el;
  26.    $w->selectionAnchor($el);
  27.    if ($w->selectionIncludes($el))
  28.     {
  29.      $w->selectionClear($el)
  30.     }
  31.    else
  32.     {
  33.      $w->selectionSet($el)
  34.     }
  35.    $w->eventGenerate("<<ListboxSelect>>");
  36.   }
  37. }
  38.  
  39. # end of Tk::Listbox::BeginToggle
  40. 1;
  41.