GDS2
view release on metacpan or search on metacpan
Examples/gds2dump view on Meta::CPAN
#### create the MainWindow (MW)
$MW = MainWindow -> new(
-background => $BGCOLOR,
-foreground => $FGCOLOR,
);
$MW -> title('dumpgds');
$MW -> iconname('dumpgds');
$MW -> minsize(1, 1);
###### start top menu bar #####
my $wMenu = $MW -> Frame(
-relief => 'raised',
-background => $BGCOLOR,
-borderwidth => 2,
);
$wMenu -> pack(-fill => 'x');
##### options menu #####
my $optionsMenu = $wMenu -> Menubutton(
-activebackground => $BGCOLOR2,
-background => $BGCOLOR,
-text => 'Options',
-underline => FALSE,
);
$optionsMenu -> separator(
-background => $BGCOLOR,
);
$optionsMenu -> radiobutton(
-activebackground => $BGCOLOR,
-variable => \$G_ECHO,
-label => 'Echo to terminal',
-value => TRUE,
);
$optionsMenu -> radiobutton(
-activebackground => $BGCOLOR,
-variable => \$G_ECHO,
-label => 'do not echo to terminal',
-value => FALSE,
);
### quit
$optionsMenu -> command(
-activebackground => 'Red',
-background => $BGCOLOR,
-label => 'Exit',
-command => sub { $MW -> destroy; exit(1); },
);
$optionsMenu -> pack(-side=>'left');
##### Help menu #####
my $textArea;
my $helpMenu = $wMenu -> Menubutton(
-text => 'Help',
-activebackground => $BGCOLOR2,
-background => $BGCOLOR,
-underline => 0
);
$helpMenu -> command(
-activebackground => $BGCOLOR2,
-background => $BGCOLOR,
-label => 'Program Version',
-command => sub {
$textArea -> delete('0.0', 'end');
$textArea -> insert('end', "dumpgds $VERSION\n");
$textArea -> insert('end', "Using Perl $]\n");
},
);
$helpMenu -> separator(
-background => $BGCOLOR,
);
$helpMenu -> command(
-activebackground => $BGCOLOR2,
-background => $BGCOLOR,
-label => 'Print help in text window',
-command => sub { \&printUsage($textArea); },
-activebackground => 'purple',
);
$helpMenu -> pack(-side=>'right');
#### end top menu bar #####################################
my $progress = $MW -> ProgressBar(
-anchor => 'w',
-width => 20,
-length => 400,
-from => 0,
-to => 98,
-troughcolor => '#000000',
-blocks => 20,
( run in 0.681 second using v1.01-cache-2.11-cpan-49f99fa48dc )