home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / auto / Tk / EnterFocus.al < prev    next >
Encoding:
Text File  |  1997-08-10  |  581 b   |  23 lines

  1. # NOTE: Derived from blib\lib\Tk.pm.  Changes made here will be lost.
  2. package Tk;
  3.  
  4. # focusFollowsMouse
  5. #
  6. # If this procedure is invoked, Tk will enter "focus-follows-mouse"
  7. # mode, where the focus is always on whatever window contains the
  8. # mouse. If this procedure isn't invoked, then the user typically
  9. # has to click on a window to give it the focus.
  10. #
  11. # Arguments:
  12. # None.
  13.  
  14. sub EnterFocus
  15. {
  16.  my $w  = shift;
  17.  my $Ev = $w->XEvent;
  18.  my $d  = $Ev->d;
  19.  $w->Tk::focus() if ($d eq "NotifyAncestor" ||  $d eq "NotifyNonlinear" ||  $d eq "NotifyInferior");
  20. }
  21.  
  22. 1;
  23.