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

  1. # sayings.pl
  2.  
  3. use vars qw/$TOP/;
  4.  
  5. sub sayings {
  6.  
  7.     # Create a top-level window containing a listbox with a bunch of
  8.     # well-known sayings.  The listbox can be scrolled or scanned in
  9.     # two dimensions.
  10.  
  11.     my($demo) = @_;
  12.     $TOP = $MW->WidgetDemo(
  13.         -name     => $demo,
  14.         -text     => 'The listbox below contains a collection of well-known sayings.  You can scan the list using either of the scrollbars or by dragging in the listbox window with button 2 pressed.',
  15.         -title    => 'Listbox Demonstration (well-known sayings)',
  16.         -iconname => 'sayings',
  17.     );
  18.  
  19.     my $list = $TOP->Scrolled(qw/Listbox -width 20 -height 10 -setgrid 1
  20.                   -scrollbars se/);
  21.     $list->pack(qw/-expand yes -fill y/);
  22.     $list->focus;
  23.  
  24.     $list->insert(0,
  25.       'Waste not, want not',
  26.       'Early to bed and early to rise makes a man healthy, wealthy, and wise',
  27.       'Ask not what your country can do for you, ask what you can do for your country',
  28.       'I shall return',
  29.       'NOT',
  30.       'A picture is worth a thousand words',
  31.       'User interfaces are hard to build',
  32.       'Thou shalt not steal',
  33.       'A penny for your thoughts',
  34.       'Fool me once, shame on you; fool me twice, shame on me',
  35.       'Every cloud has a silver lining',
  36.       'Where there\'s smoke there\'s fire',
  37.       'It takes one to know one',
  38.       'Take this job and shove it',
  39.       'Up a creek without a paddle',
  40.       'I\'m mad as hell and I\'m not going to take it any more',
  41.       'An apple a day keeps the doctor away',
  42.       'Don\'t look a gift horse in the mouth');
  43.  
  44.     $list->activate(0);
  45.  
  46. } # end sayings
  47.  
  48. 1;
  49.