home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D2.iso / workshop / apache / files / ActivePerl-5.8.3.809-MSWin32-x86.msi / _7fad83faee51eefe368c963d494cbd24 < prev    next >
Encoding:
Text File  |  2004-02-02  |  1.0 KB  |  40 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 604 "..\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.   }
  36. }
  37.  
  38. # end of Tk::Listbox::BeginToggle
  39. 1;
  40.