home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / Tk / Checkbutton.pm < prev    next >
Encoding:
Perl POD Document  |  1997-08-10  |  914 b   |  40 lines

  1. # Conversion from Tk4.0 button.tcl competed.
  2. # Copyright (c) 1992-1994 The Regents of the University of California.
  3. # Copyright (c) 1994 Sun Microsystems, Inc.
  4. # Copyright (c) 1995-1997 Nick Ing-Simmons. All rights reserved.
  5. # This program is free software; you can redistribute it and/or
  6. # modify it under the same terms as Perl itself, subject 
  7. # to additional disclaimer in license.terms due to partial
  8. # derivation from Tk4.0 sources.
  9.  
  10. package Tk::Checkbutton;  
  11. use AutoLoader;
  12. require Tk::Button;
  13.  
  14. @ISA = qw(Tk::Button);
  15.  
  16. Construct Tk::Widget 'Checkbutton';
  17.  
  18. sub Tk_cmd { \&Tk::checkbutton }
  19.  
  20. 1;
  21. __END__
  22.  
  23. sub ClassInit
  24. {
  25.  my ($class,$mw) = @_;
  26.  $mw->bind($class,"<Enter>", "Enter");
  27.  $mw->bind($class,"<Leave>", "Leave");
  28.  $mw->bind($class,"<1>", "Invoke");
  29.  $mw->bind($class,"<space>", "Invoke");
  30.  return $class;
  31. }
  32.  
  33. sub Invoke
  34. {
  35.  my $w = shift;
  36.  $w->invoke() unless($w->cget("-state") eq "disabled");
  37. }
  38.  
  39. 1;
  40.