aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormertz2003-09-24 15:10:39 +0000
committermertz2003-09-24 15:10:39 +0000
commitac066b067901451d655004ae297c173ac6b025db (patch)
tree8a2d25dcc7127ba5b6c420e60730f3eeecf95579
parentbd3db9bd35ba040a34caaf694a41efdecae463e8 (diff)
downloadtkzinc-ac066b067901451d655004ae297c173ac6b025db.zip
tkzinc-ac066b067901451d655004ae297c173ac6b025db.tar.gz
tkzinc-ac066b067901451d655004ae297c173ac6b025db.tar.bz2
tkzinc-ac066b067901451d655004ae297c173ac6b025db.tar.xz
path for either images or demo pm files are no more explicit
to avoid any use of empty directory (due for example to a previous un-installed package and which lets an empty directory behind)
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/MagicLens.pl6
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl7
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl5
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/simpleradar.pl6
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/transforms.pl3
-rw-r--r--Perl/demos/zinc-demos5
6 files changed, 16 insertions, 16 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl b/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl
index 0151de5..09e83e4 100644
--- a/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/MagicLens.pl
@@ -100,9 +100,7 @@ my $zinc = $mw->Zinc(-render => 1,
);
$zinc->pack(-fill => 'both', -expand => 1);
-# to find some images (used as textures) needed by this demo
-push @INC , Tk->findINC('demos/zinc_data');
-my $texture = &getTexture($zinc, 'paper-grey1.gif');
+my $texture = $zinc->Photo(-file => Tk->findINC('demos/zinc_data/paper-grey1.gif'));
$zinc->configure(-tile => $texture);
# création des 2 vues
@@ -113,7 +111,7 @@ my $infoview = $zinc->add('group', $lensview);
my $zoom=1.20;
$zinc->scale($infoview, $zoom, $zoom);
-my $lenstexture = &getTexture($zinc, 'paper-grey.gif');
+my $lenstexture = $zinc->Photo(-file => Tk->findINC('demos/zinc_data/paper-grey.gif'));
$zinc->add('rectangle', $infoview,
[[0,0],[1000,900]],
-filled => 1,
diff --git a/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl b/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
index 30d1755..6d3cd77 100644
--- a/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/groups_in_ATC_strips.pl
@@ -48,7 +48,9 @@ use Tk::Zinc;
use strict;
# to find some images (used as textures) needed by this demo
-my $image_path = Tk->findINC('demos/zinc_data');
+# we avoids empty 'demos/zinc_data' directory!
+my $image_path = Tk->findINC('demos/zinc_data/background_texture.gif');
+$image_path =~ s:/background_texture.gif$:: ;
$| = 1;
@@ -372,7 +374,8 @@ my $zinc = $mw->Zinc(-render => 1,
$zinc->pack(-fill => 'both', -expand => 1);
-my $texture = $zinc->Photo('background_texture.gif', -file => "$image_path/background_texture.gif");
+my $texture = $zinc->Photo('background_texture.gif',
+ -file => Tk->findINC('demos/zinc_data/background_texture.gif'));
$zinc->configure(-tile => $texture) if $texture;
diff --git a/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl b/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
index fce11c4..c5c5550 100644
--- a/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
@@ -36,9 +36,8 @@ my $zinc = $mw->Zinc(-width => 350, -height => 250,
my $earth_group = $zinc->add('group', 1, );
-my $image_path = Tk->findINC('demos/images');
-my $image_name = 'earth.gif';
-my $image = $zinc->Photo($image_name, -file => "$image_path/$image_name");
+my $image_name = 'earth.gif'; # this image is included in Perl/Tk distrib
+my $image = $zinc->Photo($image_name, -file => Tk->findINC("demos/images/$image_name"));
my $earth = $zinc->add('icon', $earth_group,
-image => $image,
diff --git a/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl b/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl
index 1aab421..4cc1363 100644
--- a/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl
@@ -13,9 +13,9 @@ use Tk;
use Tk::Zinc;
use strict;
-# to find the SimpleRadarControls module. Should be included in this source file!
-use lib Tk->findINC('demos/zinc_pm');
-use SimpleRadarControls;
+
+# to find the SimpleRadarControls module
+require Tk->findINC('demos/zinc_pm/SimpleRadarControls.pm');
# to find some maps needed by these demo
my $map_path = Tk->findINC('demos/zinc_data');
diff --git a/Perl/demos/Tk/demos/zinc_lib/transforms.pl b/Perl/demos/Tk/demos/zinc_lib/transforms.pl
index 4a5655c..0d8cab0 100644
--- a/Perl/demos/Tk/demos/zinc_lib/transforms.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/transforms.pl
@@ -29,8 +29,7 @@ my $composerot = 1;
my $composescale = 1;
my $drag = 0;
-my $image_path = Tk->findINC('demos/zinc_data');
-my $logo = $mw->Photo(-file => "$image_path/zinc_anti.gif");
+my $logo = $mw->Photo(-file => Tk->findINC('demos/zinc_data/zinc_anti.gif'));
my $text = $mw->Text(-relief => 'sunken',
-borderwidth => 2,
diff --git a/Perl/demos/zinc-demos b/Perl/demos/zinc-demos
index dcb7604..995b178 100644
--- a/Perl/demos/zinc-demos
+++ b/Perl/demos/zinc-demos
@@ -51,9 +51,10 @@ my $widget_lib = Tk->findINC('demos/widget_lib');
# found in some cases such old directory empty (e.g. after a previous package de-installation)
# So now, we look for a non-empty demos/zinc_lib directory (ie containing one of the demo!)
my $zinc_lib = Tk->findINC('demos/zinc_lib/tiger.pl');
-($zinc_lib) = $zinc_lib =~ /(.*)\//;
+($zinc_lib) = $zinc_lib =~ /(.*)\/tiger\.pl/;
my $wd = "$widget_lib/WidgetDemo.pm";
-$WIDTRIB = Tk->findINC('demos/zinc_contrib_lib');
+$WIDTRIB = Tk->findINC('demos/zinc_contrib_lib/README');
+($WIDTRIB) = $WIDTRIB =~ /(.*)\/README/;
unless (Tk::tainting) {
$WIDTRIB = $ENV{WIDTRIB} if defined $ENV{WIDTRIB};
$WIDTRIB = $ARGV[0] if defined $ARGV[0];