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

  1. @rem = '--*-Perl-*--
  2. @echo off
  3. if "%OS%" == "Windows_NT" goto WinNT
  4. perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
  5. goto endofperl
  6. :WinNT
  7. perl -x -S %0 %*
  8. if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
  9. if %errorlevel% == 9009 echo You do not have Perl in your PATH.
  10. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
  11. goto endofperl
  12. @rem ';
  13. #!/usr/local/bin/perl -w
  14. #line 15
  15.  
  16. use 5.008;
  17. use Config;
  18. use Tk 804.000;
  19. use lib Tk->findINC( 'demos/widget_lib' );
  20. use Tk::widgets qw/ DialogBox ErrorDialog LabEntry ROText /;
  21. use WidgetDemo;
  22. use subs qw/
  23.     build_about_dialog demos invoke lsearch
  24.     see_code see_vars show_stat view_widget
  25. /;
  26. use vars qw/ $MW $FONT $WIDTRIB /;
  27. use vars qw/ $CODE $CODE_RERUN $CODE_TEXT $VARS $VIEW $VIEW_TEXT /;
  28. use vars qw/ $ALIGN $BRAKES $LIGHTS $OIL $SOBER $TRANS $WIPERS /;
  29. use vars qw/ $COLOR $FONT_STYLE $POINT_SIZE $DEMO_FILE %DEMO_DESCRIPTION /;
  30. use strict;
  31.  
  32.  
  33. $MW = Tk::MainWindow->new;
  34. $MW->configure(-menu => my $menubar = $MW->Menu);
  35.  
  36. {
  37.     package WidgetWrap;
  38.     @WidgetWrap::ISA = qw/Tk::MainWindow/;
  39.  
  40.     # This magic conspires with widget's AUTOLOAD subroutine to make user
  41.     # contributed demonstrations that don't use WidgetDemo embed properly.
  42.     # The trick works because widget creates a superclass of Tk::MainWindow
  43.     # which invokes WidgetDemo() implicitly. You loose if you bypass the
  44.     # inheritance mechanism and call Tk::MainWindow directly.
  45.  
  46.     sub new {
  47.     my ($name) = $::DEMO_FILE =~ m#([^/]+).pl$#;
  48.     $::MW->WidgetDemo(-name => $name, -text => $::DEMO_DESCRIPTION{$name});
  49.     }
  50. }
  51.  
  52. @MainWindow::ISA = 'WidgetWrap';
  53.  
  54. $MW->title('Perl/Tk Widget Demonstration');
  55. $MW->iconname('widget');
  56. $FONT = 'Helvetica 12';
  57. my $widget_lib = Tk->findINC('demos/widget_lib');
  58. my $wd = "$widget_lib/WidgetDemo.pm";
  59. $WIDTRIB = Tk->findINC('demos/widtrib');
  60. unless (Tk::tainting) {
  61.     $WIDTRIB = $ENV{WIDTRIB} if defined $ENV{WIDTRIB};
  62.     $WIDTRIB = $ARGV[0] if defined $ARGV[0];
  63. }
  64.  
  65. # The code below creates the main window, consisting of a menu bar
  66. # and a text widget that explains how to use the program, plus lists
  67. # all of the demos as hypertext items.
  68.  
  69. my $file = $menubar->cascade(qw/-label File -underline 0 -menuitems/ =>
  70.     [
  71.       [cascade    => '~View', -menuitems =>
  72.         [
  73.           [command  => '~widget', -command => [\&view_widget, __FILE__]],
  74.           [command  => '~WidgetDemo', -command => [\&view_widget, $wd]],
  75.         ], # end cascade menuitems
  76.       ], # end view cascade
  77.       '',
  78.       [command    => '~Quit', -command => [\&exit]],
  79.     ]);
  80.  
  81. my $help = $menubar->cascade(qw/-label Help -underline 0 -menuitems/ =>
  82.     [
  83.       [command    => '~About'],
  84.     ]);
  85.  
  86. my $T = $MW->Scrolled('ROText',
  87.     -scrollbars         => 'e',
  88.     -wrap               => 'word',
  89.     -width              => 70,
  90.     -height             => 30,
  91.     -font               => $FONT,
  92.     -setgrid            => 1,
  93.     -highlightthickness => 0,
  94.     -padx               => 4,
  95.     -pady               => 2,
  96.     -takefocus          => 0,
  97. )->grid(qw/-sticky nsew/);
  98. $MW->gridRowconfigure(   0, -weight => 1); # allow expansion in both ...
  99. $MW->gridColumnconfigure(0, -weight => 1); # ... X and Y dimensions
  100.  
  101. my $STATUS_VAR;
  102. my $status = $MW->Label(-textvariable => \$STATUS_VAR, qw/-anchor w/);
  103. $status->grid(qw/-sticky ew/);
  104.  
  105. # Create a bunch of tags to use in the text widget, such as those for
  106. # section titles and demo descriptions.  Also define the bindings for
  107. # tags.
  108.  
  109. $T->tagConfigure(qw/title -font -*-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*/);
  110. $T->tagConfigure(qw/demo -lmargin1 1c -lmargin2 1c -foreground blue/);
  111.  
  112. if ($MW->depth  == 1) {
  113.     $T->tagConfigure(qw/hot -background black -foreground white/);
  114.     $T->tagConfigure(qw/visited -lmargin1 1c -lmargin2 1c -underline 1/);
  115. } else {
  116.     $T->tagConfigure(qw/hot -relief raised -borderwidth 1 -foreground red/);
  117.     $T->tagConfigure(qw/visited -lmargin1 1c -lmargin2 1c -foreground/ =>
  118.         '#303080');
  119. }
  120. $T->tagConfigure('bold', -font => 'Helvetica 12 bold');
  121.  
  122. $T->tagBind(qw/demo <ButtonRelease-1>/ => \&invoke);
  123. my $last_line = '';
  124. $T->tagBind(qw/demo <Enter>/ => [sub {
  125.     my($text, $sv) = @_;
  126.     my $e = $text->XEvent;
  127.     my($x, $y) = ($e->x, $e->y);
  128.     $last_line = $text->index("\@$x,$y linestart");
  129.     $text->tagAdd('hot', $last_line, "$last_line lineend");
  130.     $text->configure(qw/-cursor hand2/);
  131.     show_stat $sv, $text, $text->index('current');
  132.     }, \$STATUS_VAR]
  133. );
  134. $T->tagBind(qw/demo <Leave>/ => [sub {
  135.     my($text, $sv) = @_;
  136.     $text->tagRemove(qw/hot 1.0 end/);
  137.     $text->configure(qw/-cursor xterm/);
  138.     $$sv = '';
  139.     }, \$STATUS_VAR]
  140. );
  141. $T->tagBind(qw/demo <Motion>/ => [sub {
  142.     my($text, $sv) = @_;
  143.     my $e = $text->XEvent;
  144.     my($x, $y) = ($e->x, $e->y);
  145.     my $new_line = $text->index("\@$x,$y linestart");
  146.     if ($new_line ne $last_line) {
  147.         $text->tagRemove(qw/hot 1.0 end/);
  148.         $last_line = $new_line;
  149.         $text->tagAdd('hot', $last_line, "$last_line lineend");
  150.     }
  151.     show_stat $sv, $text, $text->index('current');
  152.     }, \$STATUS_VAR]
  153. );
  154.  
  155. # Create the text for the text widget.
  156.  
  157. $T->insert('end', "Perl/Tk Widget Demonstrations\n", 'title');
  158. $T->insert('end',
  159. "\nThis application provides a front end for several short scripts that demonstrate what you can do with Tk widgets.  Each of the numbered lines below describes a demonstration;  you can click on it to invoke the demonstration.  Once the demonstration window appears, you can click the ", '', 'See Code', 'bold', " button to see the Perl/Tk code that created the demonstration.  If you wish, you can edit the code and click the ", '', "Rerun Demo", 'bold', " button in the code window to reinvoke the demonstration with the modified code.\n"
  160. );
  161.  
  162. demos 'Getting Started', (
  163.     'hello'        => 'An introduction to Perl/Tk',
  164. );
  165.  
  166. demos 'Labels, buttons, checkbuttons, and radiobuttons', (
  167.     'labels'       => 'Labels (text and images)',
  168.     'unicodeout'   => 'Labels and Unicode text',
  169.     'button'       => 'Buttons',
  170.     'check'        => 'Checkbuttons (select any of a group)',
  171.     'radio'        => 'Radiobuttons (select one of a group)',
  172.     'puzzle'       => 'A 15-puzzle game made out of buttons',
  173.     'icon'         => 'Iconic buttons that use bitmaps',
  174.     'image1'       => 'Two labels displaying images',
  175.     'image2'       => 'A simple user interface for viewing images',
  176.     'labelframe'   => 'Labelled frames',
  177. );
  178.  
  179. demos 'Listboxes', (
  180.     'states'       => 'The 50 states',
  181.     'colors'       => 'Change widget\'s color scheme',
  182.     'sayings'      => 'A collection of famous and infamous sayings',
  183. );
  184.  
  185. demos 'Entries and Spin-boxes', (
  186.     'entry1'       => 'Entries without scrollbars',
  187.     'entry2'       => 'Entries with scrollbars',
  188.     'entry3'       => 'Validated entries and password fields',
  189.     'spin'         => 'Spin-boxes',
  190.     'form'         => 'Simple Rolodex-like form',
  191. );
  192.  
  193. demos 'Text', (
  194.     'texts'        => 'Basic editable text',
  195.     'style'        => 'Text display styles',
  196.     'bind'         => 'Hypertext (tag bindings)',
  197.     'twind'        => 'A text widget with embedded windows',
  198.     'search'       => 'A search tool built with a text widget',
  199. );
  200.  
  201. demos 'Canvases', (
  202.     'items'        => 'The canvas item types',
  203.     'plot'         => 'A simple 2-D plot',
  204.     'ctext'        => 'Text items in canvases',
  205.     'arrows'       => 'An editor for arrowheads on canvas lines',
  206.     'ruler'        => 'A ruler with adjustable tab stops',
  207.     'floor'        => 'A building floor plan',
  208.     'cscroll'      => 'A simple scrollable canvas',
  209.     'transtile'    => 'Tiles and transparent images',
  210. );
  211.  
  212. demos 'Scales', (
  213.     'hscale'       => 'Horizontal scale',
  214.     'vscale'       => 'Vertical scale',
  215. );
  216.  
  217. demos 'Paned Windows', (
  218.     'paned1'       => 'Horizontal paned window',
  219.     'paned2'       => 'Vertical paned window',
  220. );
  221.  
  222. demos 'Photos and Images', (
  223.     'photo1'       => 'Transparent pixels',
  224.     'photo2'       => 'Alpha channel compositing',
  225. );
  226.  
  227. demos 'Menus', (
  228.     'menus'        => 'Menus and cascades (sub-menus)',
  229.     'menus2'       => 'As above, but using Perl/Tk -menuitems',
  230.     'menbut'       => 'Menubuttons',
  231. );
  232.  
  233. demos 'Common Dialogs', (
  234.     'msgBox'       => 'Message boxes',
  235.     'filebox'      => 'File selection dialog',
  236.     'choosedir'    => 'Directory selection dialog',
  237.     'clrpick'      => 'Color picker',
  238. );
  239.  
  240. demos 'Tix Widgets', (
  241.     'balloon'      => 'Popup help window when mouse lingers over widget',
  242.     'browseentry'  => 'Entry with Listbox to select list values',
  243.     'browseentry2' => 'Another BrowseEntry example',
  244.     'dirtree'      => 'Display a directory tree',
  245.     'form_mgr'     => 'The form geometry manager',
  246.     'HList'        => 'A hierarchical listbox widget',
  247.     'HList2'       => 'Multicolumn listbox with individual cell styles',
  248.     'labframe'     => 'A Frame with embedded label',
  249. );
  250.  
  251. demos 'Simulations', (
  252.     'bounce'       => 'Balls bouncing in a cavity',
  253. );
  254.  
  255. demos 'Sample Perl Mega-Widgets', (
  256.     'mega'         => 'Introduction to writing pure Perl mega-widgets',
  257.     'slide'        => 'Composite Tk::SlideSwitch - binary on/off switch',
  258.     'trace2'       => 'Derived   Tk::TraceText - Text contents defined by a traced variable',
  259. );
  260.  
  261. demos 'Miscellaneous', (
  262.     'bitmaps'      => 'The built-in bitmaps',
  263.     'dialog1'      => 'A dialog box with a local grab',
  264.     'dialog2'      => 'A dialog box with a global grab',
  265.     'trace1'       => 'Trace a variable\'s value',
  266.     'progress'     => 'Various ProgressBar widgets',
  267.     'keysyms'      => 'Show keyboard symbols',
  268.     'virtevents1'  => 'Synthesizing events',
  269. );
  270.  
  271. $T->insert('end', "\n", '', "User Contributed Demonstrations\n", 'title');
  272. opendir(C, $WIDTRIB) or warn "Cannot open $WIDTRIB: $!";
  273. my(@dirent) = grep /^.+\.pl$/, sort(readdir C);
  274. closedir C;
  275. unshift @dirent, 'TEMPLATE.pl';    # I want it first
  276. my $i = 0;
  277. while ($_ = shift @dirent) {
  278.     next if /TEMPLATE\.pl/ and $i != 0;
  279.     unless (open(C, "$WIDTRIB/$_")) {
  280.     warn "Cannot open $_: $!" unless /TEMPLATE\.pl/;
  281.     next;
  282.     }
  283.     my($name) = /^(.*)\.pl$/;
  284.     $_ = <C>;
  285.     my($title) = /^#\s*(.*)$/;
  286.     $DEMO_DESCRIPTION{$name} = $title;
  287.     close C;
  288.     $T->insert('end', ++$i . ". $title\n", ['demo', "demo-$name"]);
  289. }
  290.  
  291. build_about_dialog $help;
  292. $T->focus;
  293.  
  294. MainLoop;
  295.  
  296. sub AUTOLOAD {
  297.  
  298.     # This routine handles the loading of most demo methods.
  299.  
  300.     my($demo) = @_;
  301.  
  302.     $T->Busy;
  303.     {
  304.     $DEMO_FILE = "$WIDTRIB/${demo}.pl" if -f "$WIDTRIB/${demo}.pl";
  305.     $DEMO_FILE = "$widget_lib/${demo}.pl" if -f "$widget_lib/${demo}.pl";
  306.     do $DEMO_FILE;
  307.     warn $@ if $@;
  308.     }
  309.     $T->Unbusy;
  310.     goto &$::AUTOLOAD if defined &$::AUTOLOAD;
  311.  
  312. } # end AUTOLOAD
  313.  
  314. sub build_about_dialog {
  315.  
  316.     my $help = shift;
  317.  
  318.     my $dialog = $MW->DialogBox(
  319.         -title          => "Perl/Tk, based on Tcl/Tk ${Tk::version}.x",
  320.         -default_button => 'OK',
  321.         -buttons        => ['OK'],
  322.     );
  323.     my $df = $dialog->add( 'Labelframe', -text => '  2004 - Feb - 11  ' );
  324.     $df->pack( qw/ -fill both -expand 1 / );
  325.     my( $change ) = $Tk::CHANGE =~ /Change:\s+(.*)/;
  326.     my( $tk_date ) = scalar localtime( ( stat $Tk::library )[9] );
  327.     my( $tk ) = "$Tk::VERSION ($change), $tk_date";
  328.  
  329.     foreach my $item (
  330.          [ 'Perl',    "$], $Config{cf_time}" ],
  331.          [ 'Tk',                         $tk ],
  332.          [ 'Platform',         $Tk::platform ],
  333.          [ 'Library',           $Tk::library ],
  334.         ) {
  335.         my $l = $item->[0] . ':';
  336.         my $le = $df->LabEntry(
  337.             -font         => $FONT,
  338.             -label        => ' ' x (13 - length $l) . $l,
  339.             -labelPack    => [qw/-side left -anchor w/],
  340.             -labelFont    => 'Courier 12 bold',
  341.             -relief       => 'flat',
  342.             -takefocus    => 0,
  343.             -textvariable => $item->[1],
  344.             -width        => 45,
  345.         );
  346.         $le->pack(qw/ -fill x -expand 1/);
  347.     $le->Subwidget( 'entry' )->bindtags( [ ] );
  348.     }
  349.  
  350.     $help->cget(-menu)->entryconfigure('About',
  351.         -command => [$dialog => 'Show'],
  352.     );
  353.  
  354. } # end build_about_dialog
  355.  
  356. sub demos {
  357.  
  358.     # Generate one demo section.
  359.  
  360.     my ($title, @demos) = @_;
  361.  
  362.     $T->insert('end', "\n", '', "$title\n", 'title');
  363.  
  364.     for (my $n = 0; $n <= $#demos; $n += 2) {
  365.     $T->insert('end', $n / 2 + 1 . '. ' . $demos[$n + 1] . ".\n",
  366.            ['demo', 'demo-' . $demos[$n]]);
  367.     }
  368.  
  369. } # end demos
  370.  
  371. sub invoke {
  372.  
  373.     # This procedure is called when the user clicks on a demo description.
  374.  
  375.     my($text) = @_;
  376.  
  377.     my $index = $text->index('current');
  378.     my @tags = $T->tagNames($index);
  379.     my $i = lsearch('demo\-.*', @tags);
  380.     return if $i < 0;
  381.     my($demo) = $tags[$i] =~ /demo-(.*)/;
  382.     $T->tagAdd('visited', "$index linestart", "$index lineend");
  383.     {
  384.     no strict 'refs';
  385.     $SIG{__WARN__} = sub {
  386.         print @_ unless $_[0] =~ /Subroutine \S+ redefined at/;
  387.     };
  388.     &$demo($demo);
  389.     }
  390.  
  391. } # end invoke
  392.  
  393. sub lsearch {
  394.  
  395.     # Search the list using the supplied regular expression and return it's
  396.     # ordinal, or -1 if not found.
  397.  
  398.     my($regexp, @list) = @_;
  399.     my($i);
  400.  
  401.     for ($i=0; $i<=$#list; $i++) {
  402.         return $i if $list[$i] =~ /$regexp/;
  403.     }
  404.     return -1;
  405.  
  406. } # end lsearch
  407.  
  408. sub see_code {
  409.  
  410.     # This procedure creates a toplevel window that displays the code for
  411.     # a demonstration and allows it to be edited and reinvoked.
  412.  
  413.     my($demo) = @_;
  414.  
  415.     my $file;
  416.     $file = ( $demo =~ /\.pl$/ ) ? $demo : "${demo}.pl";
  417.     if (not Exists $CODE) {
  418.     $CODE = $MW->Toplevel;
  419.     my $code_buttons = $CODE->Frame;
  420.     $code_buttons->pack(qw/-side bottom -fill x/);
  421.     my $code_buttons_dismiss = $code_buttons->Button(
  422.             -text    => 'Dismiss',
  423.             -command => [$CODE => 'withdraw'],
  424.     );
  425.     $CODE_RERUN = $code_buttons->Button(-text => 'Rerun Demo');
  426.     $CODE_TEXT = $CODE->Scrolled('Text', qw/ -height 40 -scrollbars oe /);
  427.     $code_buttons_dismiss->pack(qw/-side left -expand 1/);
  428.     $CODE_RERUN->pack(qw/-side left -expand 1/);
  429.     $CODE_TEXT->pack(qw/-side left -expand 1 -fill both/);
  430.     } else {
  431.     $CODE->deiconify;
  432.     $CODE->raise;
  433.     }
  434.     $CODE_RERUN->configure(-command => sub {
  435.     eval $CODE_TEXT->get(qw/1.0 end/);
  436.     {
  437.         no strict 'refs';
  438.         &$demo($demo);
  439.     }
  440.     });
  441.     $CODE->iconname($file);
  442.     $file = "$WIDTRIB/$file" if -f "$WIDTRIB/$file";
  443.     $file = "$widget_lib/$file" if -f "$widget_lib/$file";
  444.     $CODE->title("Demo code: $file");
  445.     $CODE_TEXT->delete(qw/1.0 end/);
  446.     open(CODE, "<$file") or warn "Cannot open demo file $file: $!";
  447.     {
  448.     local $/ = undef;
  449.     $CODE_TEXT->insert('1.0', <CODE>);
  450.     }
  451.     close CODE;
  452.     $CODE_TEXT->markSet(qw/insert 1.0/);
  453.     $CODE_TEXT->focus;
  454.  
  455. } # end see_code
  456.  
  457. sub see_vars {
  458.  
  459.     # Create a top-level window that displays a bunch of global variable values
  460.     # and keeps the display up-to-date even when the variables change value.
  461.     # $args is a pointer to a list of list of 2:
  462.     #
  463.     #   ["variable description", \$VAR]
  464.     #
  465.     # The old trick of passing a string to serve as the description and a soft
  466.     # reference to the variable no longer works with lexicals and use strict.
  467.  
  468.     my($parent, $args) = @_;
  469.  
  470.     $VARS->destroy if Exists($VARS);
  471.     $VARS = $parent->Toplevel;
  472.     $VARS->geometry('+300+300');
  473.     $VARS->title('Variable Values');
  474.     $VARS->iconname('Variables');
  475.  
  476.     my $title = $VARS->Label(
  477.         -text   => 'Variable Values:',
  478.         -width  => 20,
  479.         -anchor => 'center',
  480.         -font   => '-*-helvetica-medium-r-normal--*-180-*-*-*-*-*-*',
  481.     );
  482.     $title->pack(qw/-side top -fill x/);
  483.     my($label, $var);
  484.     foreach my $i (@$args) {
  485.     ($label, $var) = @$i;
  486.     my $wf = $VARS->Frame->pack(qw/-anchor w/);
  487.     $wf->Label(-text => "$label: ")->pack(qw/-side left/);
  488.     $wf->Label(-textvariable => $var)->pack(qw/-side left/);
  489.     }
  490.     $VARS->Button(-text => 'OK', -command => [$VARS => 'destroy'])->
  491.         pack(qw/-side bottom -pady 2/);
  492.  
  493. } # end see_vars
  494.  
  495. sub show_stat {
  496.  
  497.     # Display name of current demonstration.  $sv is a reference to the
  498.     # status Label -textvariable, $text is the Text widget reference and
  499.     # $index is the demonstration index in the Text widget.
  500.  
  501.     my($sv, $text, $index) = @_;
  502.  
  503.     my @tags = $text->tagNames($index);
  504.     my $i = lsearch('demo\-.*', @tags);
  505.     return if $i < 0;
  506.     my($demo) = $tags[$i] =~ /demo-(.*)/;
  507.     $$sv = "Click Button-1 to run the \"$demo\" demonstration.";
  508.  
  509. } # end show_stat
  510.  
  511. sub view_widget {
  512.  
  513.     # Expose a file's innards to the world too, but only for viewing.
  514.  
  515.     my($widget) = @_;
  516.  
  517.     if (not Exists $VIEW) {
  518.     $VIEW = $MW->Toplevel;
  519.     $VIEW->iconname('widget');
  520.     my $view_buttons = $VIEW->Frame;
  521.     $view_buttons->pack(qw/-side bottom -fill x/);
  522.     my $view_buttons_dismiss = $view_buttons->Button(
  523.             -text    => 'Dismiss',
  524.             -command => [$VIEW => 'withdraw'],
  525.     );
  526.     $view_buttons_dismiss->pack(qw/-side left -expand 1/);
  527.     $VIEW_TEXT = $VIEW->Scrolled('Text', qw/ -height 40 -scrollbars oe /);
  528.     $VIEW_TEXT->pack(qw/-side left -expand 1 -fill both/);
  529.     } else {
  530.     $VIEW->deiconify;
  531.     $VIEW->raise;
  532.     }
  533.     $VIEW->title("Demo code: $widget");
  534.     $VIEW_TEXT->configure(qw/-state normal/);
  535.     $VIEW_TEXT->delete(qw/1.0 end/);
  536.     open(VIEW, "<$widget") or warn "Cannot open demo file $widget: $!";
  537.     {
  538.     local $/ = undef;
  539.     $VIEW_TEXT->insert('1.0', <VIEW>);
  540.     }
  541.     close VIEW;
  542.     $VIEW_TEXT->markSet(qw/insert 1.0/);
  543.     $VIEW_TEXT->configure(qw/-state disabled/);
  544.  
  545. } # end view_widget
  546.  
  547. =head1 NAME
  548.  
  549. widget - Demonstration of Perl/Tk widgets
  550.  
  551. =head1 SYNOPSYS
  552.  
  553.   widget [ directory ]
  554.  
  555. =head1 DESCRIPTION
  556.  
  557. This script demonstrates the various widgets provided by Tk, along with
  558. many of the features of the Tk toolkit.  This file only contains code to
  559. generate the main window for the application, which invokes individual
  560. demonstrations.  The code for the actual demonstrations is contained in
  561. separate ".pl" files in the "widget_lib" directory, which are autoloaded
  562. by this script as needed.
  563.  
  564. widget looks in the directory specified on the command line to load user
  565. contributed demonstrations.  If no directory name is specified when widget is
  566. invoked and the environment variable WIDTRIB is defined then demonstrations
  567. are loaded from the WIDTRIB directory. If WIDTRIB is undefined then widget
  568. defaults to the released user contributed directory, "widtrib".
  569.  
  570. =head2 History
  571.  
  572.  #
  573.  # Stephen O. Lidie, LUCC, 96/03/11.  lusol@Lehigh.EDU
  574.  # Stephen O. Lidie, LUCC, 97/01/01.  lusol@Lehigh.EDU
  575.  # Stephen O. Lidie, LUCC, 97/02/11.  lusol@Lehigh.EDU
  576.  # Stephen O. Lidie, LUCC, 97/06/07.  lusol@Lehigh.EDU
  577.  #     Update for Tk402.00x.  Total revamp:  WidgetDemo, Scrolled, released
  578.  #     composites, -menuitems, qw//, etcetera.  Perl 5.004 required.
  579.  # Stephen O. Lidie, LUCC, 98/03/10.  lusol@Lehigh.EDU
  580.  #     Update for Tk8.
  581.  # Stephen O. Lidie, LUCC, 98/06/26.  Stephen.O.Lidie@Lehigh.EDU
  582.  #     Add Common Dialogs for Tk800.007.
  583.  # Stephen.O.Lidie@Lehigh.EDU, 1999/11/29, Lehigh University.
  584.  #     Demo some "dash patch" changes.
  585.  # Stephen.O.Lidie@Lehigh.EDU, 2000/01/11, Lehigh University.
  586.  #     Update menubar to Tk 8, fix color palette Menubutton demo.
  587.  # Stephen.O.Lidie@Lehigh.EDU, 2000/07/06, Lehigh University.
  588.  #     Remove inswt() from widget and styles.pl to show the proper Perl/Tk
  589.  #     idiom for inserting Text tags.  Various and sundry cleanups.
  590.  # sol0@lehigh.edu, 2003/07/29, Lehigh University Computing Center.
  591.  #     Update for Tk 8.4.4.
  592.  
  593. =head1 AUTHOR
  594.  
  595. Steve Lidie <sol0@Lehigh.EDU>
  596.  
  597. =cut
  598.  
  599. __END__
  600. :endofperl
  601.