home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _d193559bbb85309289a05a14cc780dfe < prev    next >
Text File  |  2004-06-01  |  1KB  |  29 lines

  1. # states.pl
  2.  
  3. use vars qw/$TOP/;
  4.  
  5. sub states {
  6.  
  7.     # Create a top-level window that displays a listbox with the names of the
  8.     # 50 states.
  9.  
  10.     my($demo) = @_;
  11.     $TOP = $MW->WidgetDemo(
  12.         -name     => $demo,
  13.         -text     => 'A listbox containing the 50 states is displayed below, along with a scrollbar.  You can scan the list either using the scrollbar or by scanning.  To scan, press button 2 in the widget and drag up or down.',
  14.         -title    => 'Listbox Demonstration (50 states)',
  15.         -iconname => 'states',
  16.     );
  17.  
  18.     my $list = $TOP->Scrolled(qw/Listbox -setgrid 1 -height 12 -scrollbars e/);
  19.     $list->pack(qw/-side left -expand yes -fill both/);
  20.     $list->focus;
  21.  
  22.     $list->insert(0, qw/Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada/, 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', qw/Ohio Oklahoma Oregon Pennsylvania/, 'Rhode Island', 'South Carolina', 'South Dakota', qw/Tennessee Texas Utah Vermont Virginia Washington/, 'West Virginia', 'Wisconsin', 'Wyoming');
  23.  
  24.     $list->activate(0);
  25.  
  26. } # end states
  27.  
  28. 1;
  29.