ZooZ

 view release on metacpan or  search on metacpan

ZooZ.pl  view on Meta::CPAN

			    ['All Files',  '*'    ],
			   ],
			  );
  $f or return;

  $PM_FILES[$CURID] = $f;

  goto &dumpPerlPM;
}

sub dumpPerlPM {
  DUMP_PM_SUPPORT or return
    ZooZ::Generic::popMessage(-over  => $MW,
			      -msg   => 'Not implemented yet!',
			      -delay => 1500,
			      -bg    => 'white',
			      -font  => 'Level');

  $OPEN_PROJECTS[$CURID] or return
    ZooZ::Generic::popMessage(-over  => $MW,
			      -msg   => 'No active project.',
			      -delay => 1500,
			      -bg    => 'white',
			      -font  => 'Level');

  goto &dumpPerlPMAs unless defined $PM_FILES[$CURID];

  open my $fh, "> $PM_FILES[$CURID]" or die "$PM_FILES[$CURID]: $!\n";

  $MW->Busy;

  # some headers.
  my $time = localtime;

  my $h    = DEBUG ? "use lib '/home/aqumsieh/Tk804.025_beta15/lib/site_perl/5.8.3/i686-linux';\n" : '';
  my $pack = $NAMES[$CURID];

  $pack =~ s/\W/_/g;

  print $fh <<EOT;

package $pack;

##################
#
# This file was automatically generated by ZooZ.pl v$VERSION
# on $time.
# Project: $NAMES[$CURID]
# File:    $PROJECT_FILES[$CURID]
#
##################

#
# Headers
#
use strict;
use warnings;
$h

use Tk 804;
use base qw/Tk::Derived Tk::Frame/;

Construct Tk::Widget '$pack';

our \%ZWIDGETS;

#
# User-defined variables (if any)
#
EOT
  ;

  # now dump the user-defined vars.
  my $vars = stringifyVars();
  print $fh $_ for @$vars;

  print $fh <<'EOT';

sub ClassInit {
  my ($class, $mw) = @_;

  # load any fonts or images
  ZloadImages($mw);
  ZloadFonts ($mw);
}

sub Populate {
  my ($w, $args) = @_;

  $w->SUPER::Populate($args);

  # need to create a dummy Frame to prevent
  # Tk overriding subwidget configurations.
  my $f = $w->Frame->pack(qw/-fill both -expand 1/);

EOT
  ;

  # Now let the project do it's thing.
  $PROJECTS[$CURID]->dumpPerl($fh, 1, '$f');

  print $fh "\n\n";

  # Advertise all the widgets
  my $allWidgets = $PROJECTS[$CURID]->allWidgetsHash;
  for my $name (keys %$allWidgets) {
    print $fh "  \$w->Advertise('$name' => \$ZWIDGETS{'$name'});\n";
  }

  # finish off
  print $fh <<EOT;
\}

#######################
#
# Subroutines
#
#######################

EOT
  ;



( run in 1.332 second using v1.01-cache-2.11-cpan-13bb782fe5a )