From 6a7ccb7fe33c23e765827604e735910bff4f6a29 Mon Sep 17 00:00:00 2001 From: mertz Date: Tue, 8 Jul 2003 13:20:40 +0000 Subject: 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 --- Perl/demos/Tk/demos/zinc_lib/color-circular.pl | 8 +++++++- Perl/demos/Tk/demos/zinc_lib/color-path-and-conic.pl | 8 +++++++- Perl/demos/Tk/demos/zinc_lib/color-x.pl | 10 ++++++++-- Perl/demos/Tk/demos/zinc_lib/color-y.pl | 9 ++++++++- 4 files changed, 30 insertions(+), 5 deletions(-) (limited to 'Perl/demos/Tk') 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; -- cgit v1.1