aboutsummaryrefslogtreecommitdiff
path: root/Perl
diff options
context:
space:
mode:
Diffstat (limited to 'Perl')
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/clipping.pl48
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl17
2 files changed, 34 insertions, 31 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/clipping.pl b/Perl/demos/Tk/demos/zinc_lib/clipping.pl
index a31d602..b5ace04 100644
--- a/Perl/demos/Tk/demos/zinc_lib/clipping.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/clipping.pl
@@ -7,6 +7,8 @@ use Tk::Zinc;
use strict;
use Tk::Checkbutton;
+package clipping;
+
my $defaultfont = '-adobe-helvetica-bold-r-normal-*-120-*-*-*-*-*-*';
my $mw = MainWindow->new();
my $zinc = $mw->Zinc(-width => 700, -height => 600,
@@ -49,19 +51,19 @@ my $tan_group = $zinc->add('group', $clipped_group,
-sensitive => 1,
);
-my $arc = $zinc->add('arc', $tan_group,
- [200, 220, 280, 300],
- -filled => 1, -linewidth => 1,
- -startangle => 45, -extent => 270,
- -pieslice => 1, -closed => 1,
- -fillcolor => "tan",
- );
+$zinc->add('arc', $tan_group,
+ [200, 220, 280, 300],
+ -filled => 1, -linewidth => 1,
+ -startangle => 45, -extent => 270,
+ -pieslice => 1, -closed => 1,
+ -fillcolor => "tan",
+ );
-my $bezier = $zinc->add('bezier', $tan_group,
- [400,400, 400,500, 500,500, 500,400],
- -filled => 1, -fillcolor => "tan",
- -linecolor => "tan",
- );
+$zinc->add('bezier', $tan_group,
+ [400,400, 400,500, 500,500, 500,400],
+ -filled => 1, -fillcolor => "tan",
+ -linecolor => "tan",
+ );
############### creating the blue_group objects ################
# the blue_group is atomic too, that is is makes all children as a single object
@@ -72,17 +74,17 @@ my $blue_group = $zinc->add('group', $clipped_group,
-sensitive => 1,
);
-my $arc = $zinc->add('rectangle', $blue_group,
- [570,180, 470,280],
- -filled => 1, -linewidth => 1,
- -fillcolor => "blue2",
- );
+$zinc->add('rectangle', $blue_group,
+ [570,180, 470,280],
+ -filled => 1, -linewidth => 1,
+ -fillcolor => "blue2",
+ );
-my $bezier = $zinc->add('bezier', $blue_group,
- [200,400, 200,500, 300,500, 300,400, 300,300],
- -filled => 1, -fillcolor => "blue",
- -linewidth => 0,
- );
+$zinc->add('bezier', $blue_group,
+ [200,400, 200,500, 300,500, 300,400, 300,300],
+ -filled => 1, -fillcolor => "blue",
+ -linewidth => 0,
+ );
$zinc->itemconfigure($clipped_group, -clip => $clipping_item);
@@ -142,4 +144,4 @@ sub clip {
}
}
-MainLoop;
+Tk::MainLoop;
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 15f2004..0403ff8 100644
--- a/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/icon_zoom_resize.pl
@@ -6,6 +6,7 @@ use Tk;
use Tk::Zinc;
use strict;
+package icon_zoom__resize; # for avoiding symbol re-use between different demos
my $defaultfont = '-adobe-helvetica-bold-r-normal-*-140-*-*-*-*-*-*';
my $mw = MainWindow->new();
@@ -40,13 +41,13 @@ my $earth = $zinc->add('icon', $earth_group,
-composescale => 1,
-composerotation => 1,
);
-my $text = $zinc->add('text', $earth_group,
- -connecteditem => $earth,
- -text => "try to zoom/resize the earth!",
- -color => "white",
- -composescale => 1,
- -composerotation => 1,
- );
+$zinc->add('text', $earth_group,
+ -connecteditem => $earth,
+ -text => "try to zoom/resize the earth!",
+ -color => "white",
+ -composescale => 1,
+ -composerotation => 1,
+ );
$zinc->Tk::bind('<ButtonPress-1>', [\&press, \&zoom]);
$zinc->Tk::bind('<ButtonRelease-1>', [\&release]);
@@ -150,4 +151,4 @@ sub release {
$zinc->Tk::bind('<Motion>', '');
}
-MainLoop;
+Tk::MainLoop;