diff options
author | mertz | 2002-03-13 15:51:34 +0000 |
---|---|---|
committer | mertz | 2002-03-13 15:51:34 +0000 |
commit | 44ce85a555cc01465cd599e8f17575e43548dec4 (patch) | |
tree | de98dbc76682c3304d9fb2c926222c709d1417b0 /Perl/demos/Tk/demos | |
parent | 48484c953755ca0216487ed7862212e938eddcad (diff) | |
download | tkzinc-44ce85a555cc01465cd599e8f17575e43548dec4.zip tkzinc-44ce85a555cc01465cd599e8f17575e43548dec4.tar.gz tkzinc-44ce85a555cc01465cd599e8f17575e43548dec4.tar.bz2 tkzinc-44ce85a555cc01465cd599e8f17575e43548dec4.tar.xz |
utilisation du background de l'item de clip plutot que son contour...
(sur une suggestion de PLC)
Diffstat (limited to 'Perl/demos/Tk/demos')
-rw-r--r-- | Perl/demos/Tk/demos/zinc_lib/clipping.pl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/clipping.pl b/Perl/demos/Tk/demos/zinc_lib/clipping.pl index 8ee9f63..a31d602 100644 --- a/Perl/demos/Tk/demos/zinc_lib/clipping.pl +++ b/Perl/demos/Tk/demos/zinc_lib/clipping.pl @@ -15,7 +15,7 @@ my $zinc = $mw->Zinc(-width => 700, -height => 600, -borderwidth => 3, -relief => 'sunken', )->pack; -my $display_clipping_area_limits = 1; +my $display_clipping_item_background = 0; my $clip = 1; $zinc->add('text', 1, @@ -34,7 +34,10 @@ my $clipping_item = $zinc->add('curve', $clipped_group, [10,100, 690,100, 690,590, 520,300, 350,590, 180,300, 10,590], -closed => 1, - -linewidth => $display_clipping_area_limits); + -priority => 1, + -fillcolor => "tan2", + -linewidth => 0, + -filled => $display_clipping_item_background); $zinc->contour($clipping_item, "diff", [200,200, 500,200, 500,250, 200,250]); ############### creating the tan_group objects ################ @@ -118,8 +121,8 @@ sub release { } ###################### toggle buttons at the bottom ####### my $row = $mw->Frame()->pack(); -$row->Checkbutton(-text => 'Show clipping limits', - -variable => \$display_clipping_area_limits, +$row->Checkbutton(-text => 'Show clipping item', + -variable => \$display_clipping_item_background, -command => \&display_clipping_area)->pack; $row->Checkbutton(-text => 'Clip', @@ -127,7 +130,7 @@ $row->Checkbutton(-text => 'Clip', -command => \&clip)->pack; sub display_clipping_area { - $zinc->itemconfigure($clipping_item, -linewidth => $display_clipping_area_limits); + $zinc->itemconfigure($clipping_item, -filled => $display_clipping_item_background); } sub clip { @@ -135,7 +138,6 @@ sub clip { $zinc->itemconfigure($clipped_group, -clip => $clipping_item); } else { - print "unclip\n"; $zinc->itemconfigure($clipped_group, -clip => undef); } } |