Commit | Line | Data |
---|---|---|
86530b38 AT |
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 | ||
21 | $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'); | |
22 | ||
23 | } # end states | |
24 | ||
25 | 1; |