0
  7   %ˆl–ßi~” T¾R( 	ÅýÁ
àS�ÿ‘äÇò 8à_uÐ¶ë¡ ÿŸÕƒh¹ÔÆÒ      %auto
  6   'ˆl–ß=¿J	•4Å2 EpÜJbÑ¿�þZ�dY¹]|N†0ùÖ„ï<×ÕÇÓ ?÷     '#!/usr/bin/perl

use 5.008;
use Config;
use Tk 804.000;
use lib Tk->findINC( 'demos/widget_lib' );
use Tk::widgets qw/ DialogBox ErrorDialog LabEntry ROText /;
use Tk::Config ();
use WidgetDemo;
use subs qw/
    build_about_dialog demos invoke lsearch
    see_code see_vars show_stat view_widget
/;
use vars qw/ $MW $FONT $BOLD_FONT $LARGE_FONT $MONOSPACE_FONT $WIDTRIB /;
use vars qw/ $CODE $CODE_RERUN $CODE_TEXT $VARS $VIEW $VIEW_TEXT /;
use vars qw/ $ALIGN $BRAKES $LIGHTS $OIL $SOBER $TRANS $WIPERS /;
use vars qw/ $COLOR $FONT_STYLE $POINT_SIZE $DEMO_FILE %DEMO_DESCRIPTION $XFT /;
use strict;

$XFT = $Tk::Config::xlib =~ /-lXft\b/;

$MW = Tk::MainWindow->new;
$MW->configure(-menu => my $menubar = $MW->Menu);

{
    package WidgetWrap;
    @WidgetWrap::ISA = qw/Tk::MainWindow/;

    # This magic conspires with widget's AUTOLOAD subroutine to make user
    # contributed demonstrations that don't use WidgetDemo embed properly.
    # The trick works because widget creates a superclass of Tk::MainWindow
    # which invokes WidgetDemo() implicitly. You loose if you bypass the
    # inheritance mechanism and call Tk::MainWindow directly.

    sub new {
	my ($name) = $::DEMO_FILE =~ m#([^/]+).pl$#;
	$::MW->WidgetDemo(-name => $name, -text => $::DEMO_DESCRIPTION{$name});
    }
}

@MainWindow::ISA = 'WidgetWrap';

$MW->title('Perl/Tk Widget Demonstration');
$MW->iconname('widget');

my $DEFAULT_FONT_FAMILY = $XFT ? "sans-serif" : "Helvetica";
{
    $FONT           = "$DEFAULT_FONT_FAMILY 12";
    $BOLD_FONT      = "$DEFAULT_FONT_FAMILY 12 bold";
    $LARGE_FONT     = "$DEFAULT_FONT_FAMILY 18";
    $MONOSPACE_FONT = "Courier 12";
    my $l = $MW->Label;
    my $default_font = $l->cget(-font);
    if ($default_font) {
	my %default_font = $MW->fontActual($default_font);
	$FONT           = $MW->fontCreate(%default_font, -family => $DEFAULT_FONT_FAMILY);
	$BOLD_FONT      = $MW->fontCreate(%default_font, -family => $DEFAULT_FONT_FAMILY, -weight => "bold");
	$LARGE_FONT     = $MW->fontCreate(%default_font, -family => $DEFAULT_FONT_FAMILY, -weight => "bold", -size => -18);
	$MONOSPACE_FONT = $MW->fontCreate(%default_font, -family => $XFT ? "monospace" : "Courier");
	$MW->optionAdd("*font", $FONT);
    }
    $l->destroy;
}

my $widget_lib = Tk->findINC('demos/widget_lib');
my $wd = "$widget_lib/WidgetDemo.pm";
$WIDTRIB = Tk->findINC('demos/widtrib');
unless (Tk::tainting) {
    $WIDTRIB = $ENV{WIDTRIB} if defined $ENV{WIDTRIB};
    $WIDTRIB = $ARGV[0] if defined $ARGV[0];
}

# The code below creates the main window, consisting of a menu bar
# and a text widget that explains how to use the program, plus lists
# all of the demos as hypertext items.

my $file = $menubar->cascade(qw/-label File -underline 0 -menuitems/ =>
    [
      [cascade    => '~View', -menuitems =>
        [
          [command  => '~widget', -command => [\&view_widget, __FILE__]],
          [command  => '~WidgetDemo', -command => [\&view_widget, $wd]],
        ], # end cascade menuitems
      ], # end view cascade
      '',
      [command    => '~Quit', -command => [\&exit], -accelerator => 'Ctrl-Q'],
    ]);

my $help = $menubar->cascade(qw/-label Help -underline 0 -menuitems/ =>
    [
      [command    => '~About'],
    ]);

my $T = $MW->Scrolled('ROText',
    -scrollbars         => 'e',
    -wrap               => 'word',
    -width              => 70,
    -height             => 30,
    -font               => $FONT,
    -setgrid            => 1,
    -highlightthickness => 0,
    -padx               => 4,
    -pady               => 2,
    -takefocus          => 0,
)->grid(qw/-sticky nsew/);
$MW->gridRowconfigure(   0, -weight => 1); # allow expansion in both ...
$MW->gridColumnconfigure(0, -weight => 1); # ... X and Y dimensions

$MW->bind('<Control-q>' => \&exit);

my $STATUS_VAR;
my $status = $MW->Label(-textvariable => \$STATUS_VAR, qw/-anchor w/);
$status->grid(qw/-sticky ew/);

# Create a bunch of tags to use in the