aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormertz2003-07-08 13:20:40 +0000
committermertz2003-07-08 13:20:40 +0000
commit6a7ccb7fe33c23e765827604e735910bff4f6a29 (patch)
treeb8c54178241eee44ca108567f60a172df9ac1e59
parent4956f1922f8b9e655adb9309801d8daa8a34f252 (diff)
downloadtkzinc-6a7ccb7fe33c23e765827604e735910bff4f6a29.zip
tkzinc-6a7ccb7fe33c23e765827604e735910bff4f6a29.tar.gz
tkzinc-6a7ccb7fe33c23e765827604e735910bff4f6a29.tar.bz2
tkzinc-6a7ccb7fe33c23e765827604e735910bff4f6a29.tar.xz
The color*pl demo do not die any more when there is no openGL. However they
display a string explaining that there is no gradient without openGL support
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-circular.pl8
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl8
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-x.pl10
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/color-y.pl9
4 files changed, 30 insertions, 5 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-circular.pl b/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
index 73c8d4a..100449f 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-circular.pl
@@ -13,7 +13,8 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
-render => 1, # for activating the openGL render
)->pack;
-die "no openGL rendering on this X server" unless $zinc->cget(-render);
+# This demo no more dies if there is no openGL. It simply displays
+# a string on the bootom of the window!
$zinc->add('rectangle', 1, [10, 10, 80, 80], -fillcolor => "=radial 50 50 |red |blue", -filled => 1);
@@ -61,6 +62,11 @@ $zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "=radial -40 -40 |black
$zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "=radial 40 40 |black;70|white;20", -filled => 1);
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "WITHOUT openGL, NO GRADIENT. SORRY!",
+ -anchor => 'nw',
+ -position => [20, 550]) unless $zinc->cget(-render);
MainLoop;
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl b/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl
index 2755358..2d21f93 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl
@@ -13,7 +13,8 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
-render => 1, # for activating the openGL render
)->pack;
-die "no openGL rendering on this X server" unless $zinc->cget(-render);
+# This demo no more dies if there is no openGL. It simply displays
+# a string on the bootom of the window!
$zinc->add('rectangle', 1, [10, 10, 80, 80], -fillcolor => "=path 0 0 |red |blue", -filled => 1);
@@ -64,6 +65,11 @@ $zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "=conical -40 -40 135 |
#$zinc->add('arc', 1, [580, 410, 680, 580], -fillcolor => "=radial 40 40 |black;70|white;20", -filled => 1);
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "WITHOUT openGL, NO GRADIENT. SORRY!",
+ -anchor => 'nw',
+ -position => [20, 550]) unless $zinc->cget(-render);
MainLoop;
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-x.pl b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
index d576102..072aaea 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-x.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-x.pl
@@ -13,8 +13,8 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
-render => 1, # for activating the openGL render
)->pack;
-die "no openGL rendering on this X server" unless $zinc->cget(-render);
-
+# This demo no more dies if there is no openGL. It simply displays
+# a string on the bootom of the window!
$zinc->add('rectangle', 1, [10,10, 690, 50], -fillcolor => "=axial 0 | red | blue", -filled => 1);
@@ -76,6 +76,12 @@ $zinc->add('rectangle', 1, [200, 350, 500, 580], -fillcolor => "red;40|green;40
$zinc->add('rectangle', 1, [10, 400, 690, 500], -fillcolor => "=axial 0 |yellow;40|black;40 50|cyan;40", -filled => 1);
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "WITHOUT openGL, NO GRADIENT. SORRY!",
+ -anchor => 'nw',
+ -position => [20, 550]) unless $zinc->cget(-render);
+
MainLoop;
diff --git a/Perl/demos/Tk/demos/zinc_lib/color-y.pl b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
index c450c72..d16418a 100644
--- a/Perl/demos/Tk/demos/zinc_lib/color-y.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/color-y.pl
@@ -14,7 +14,8 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600,
-render => 1, # for activating the openGL render
)->pack;
-die "no openGL rendering on this X server" unless $zinc->cget(-render);
+# This demo no more dies if there is no openGL. It simply displays
+# a string on the bootom of the window!
$zinc->add('rectangle', 1, [10, 10, 340, 100], -fillcolor => "=axial 90 |red |blue", -filled => 1);
@@ -76,6 +77,12 @@ $zinc->add('rectangle', 1, [200, 350, 500, 580], -fillcolor => "=axial 90 |red;4
$zinc->add('rectangle', 1, [10, 400, 690, 500], -fillcolor => "=axial 90 |yellow;40|black;40 50|cyan;40", -filled => 1);
+$zinc->add('text', 1,
+ -font => $defaultfont,
+ -text => "WITHOUT openGL, NO GRADIENT. SORRY!",
+ -anchor => 'nw',
+ -position => [20, 550]) unless $zinc->cget(-render);
+
MainLoop;