home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _f21c0cb3b5835e32e80b0caa9d34c051 < prev    next >
Encoding:
Text File  |  2004-06-01  |  1009 b   |  32 lines

  1. # form.pl
  2.  
  3. use vars qw/$TOP/;
  4.  
  5. sub form {
  6.  
  7.     # Create a top-level window that displays a bunch of entries with
  8.     # tabs set up to move between them.
  9.  
  10.     my($demo) = @_;
  11.     $TOP = $MW->WidgetDemo(
  12.         -name     => $demo,
  13.         -text     => 'This window contains a simple form where you can type in the various entries and use tabs to move circularly between the entries.',
  14.         -title    => 'Form Demonstration',
  15.         -iconname => 'form',
  16.     );
  17.     my $f = $TOP->Frame->pack(-fill => 'both');
  18.     my $row = 0;
  19.     foreach ('Name:', 'Address:', '', '', 'Phone:') {
  20.     my $e = $f->Entry(qw/-relief sunken -width 40/);
  21.     my $l = $f->Label(-text => $_, -anchor => 'e', -justify => 'right');
  22.         $l->grid(-row => $row, -column => 0, -sticky => 'e');
  23.         $e->grid(-row => $row++, -column => 1,-sticky => 'ew');
  24.         $f->gridRowconfigure(1,-weight => 1);
  25.     $e->focus if $_ eq 'Name:';
  26.     }
  27.     $TOP->bind('<Return>' => [$TOP => 'destroy']);
  28.  
  29. } # end form
  30.  
  31. 1;
  32.