home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / numentry.pl < prev    next >
Encoding:
Perl Script  |  2002-11-17  |  553 b   |  31 lines

  1. # Entry for entering numeric values.
  2. #!/usr/local/bin/perl -w
  3. use strict;
  4. use Tk;
  5. use Tk::NumEntry;
  6. use strict;
  7.  
  8. my $mw = Tk::MainWindow->new;
  9.  
  10. my $nume = $mw->NumEntry( -command => sub { print "Value = ",@_,"\n" });
  11.  
  12. $nume->pack(-side => 'top', -fill => 'x');
  13.  
  14. $nume = $mw->NumEntry(
  15.         -minvalue => 10,
  16.         -maxvalue => 100,
  17.         -defaultvalue => -2,
  18.         -command => sub { print "Value = ",@_,"\n" }
  19. );
  20.  
  21. $nume->pack(-side => 'top', -fill => 'x');
  22.  
  23. $nume = $mw->NumEntry(
  24.         -readonly => 1,
  25. );
  26.  
  27. $nume->pack(-side => 'top', -fill => 'x');
  28.  
  29. Tk::MainLoop;
  30. __END__
  31.