home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _e8421b9e8b790428f64857f01cccbcbb < prev    next >
Text File  |  2004-06-01  |  1KB  |  47 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 515 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\BeginSelect.al)"
  7. # BeginSelect --
  8. #
  9. # This procedure is typically invoked on button-1 presses. It begins
  10. # the process of making a selection in the listbox. Its exact behavior
  11. # depends on the selection mode currently in effect for the listbox;
  12. # 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 BeginSelect
  19. {
  20.  my $w = shift;
  21.  my $el = shift;
  22.  if ($w->cget('-selectmode') eq 'multiple')
  23.   {
  24.    if ($w->selectionIncludes($el))
  25.     {
  26.      $w->selectionClear($el)
  27.     }
  28.    else
  29.     {
  30.      $w->selectionSet($el)
  31.     }
  32.   }
  33.  else
  34.   {
  35.    $w->selectionClear(0,'end');
  36.    $w->selectionSet($el);
  37.    $w->selectionAnchor($el);
  38.    @Selection = ();
  39.    $Prev = $el
  40.   }
  41.  $w->focus if ($w->cget('-takefocus'));
  42.  $w->eventGenerate("<<ListboxSelect>>");
  43. }
  44.  
  45. # end of Tk::Listbox::BeginSelect
  46. 1;
  47.