From cfd9fe1d670a59bc5d82056274cd05c3b98974b4 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 27 Jun 2001 08:38:42 +0000 Subject: *** empty log message *** --- sandbox/local.pl | 16 ++++++++++------ sandbox/testarc.tcl | 32 ++++++++++++++++---------------- sandbox/testrelief.tcl | 2 +- sandbox/testtext.tcl | 2 +- sandbox/testzinc.pl | 12 ++++++++---- 5 files changed, 36 insertions(+), 28 deletions(-) (limited to 'sandbox') diff --git a/sandbox/local.pl b/sandbox/local.pl index f448420..80505d8 100644 --- a/sandbox/local.pl +++ b/sandbox/local.pl @@ -2,6 +2,7 @@ use Tk; use Tk::Zinc; +use Controls; $mw = MainWindow->new(); $logo = $mw->Photo(-file => "logo.gif"); @@ -9,7 +10,8 @@ $papier = $mw->Photo(-file => "texture-paper.xpm"); #$penguin = $mw->Photo(-file => "xpenguin.png"); $top = 1; -$zinc = $mw->Zinc(-Render, -relief => 'sunken'); +$zinc = $mw->Zinc(-render => 1, + -relief => 'sunken'); $zinc->pack(-expand => 1, -fill => 'both'); $zinc->configure(-width => 500, -height => 500); $gr1 = $zinc->add('group', $top); @@ -25,17 +27,17 @@ $zinc->lower($clip); $zinc->lower($clip2); $rect = $zinc->add('rectangle', $view, [100, 100, 200, 200], - -linewidth => 4, -tile => $papier, + -linewidth => 4, # -tile => $papier, -fillcolor => 'pink', -fillalpha => 128, -filled => 1); $fvwm = $zinc->add('icon', $view, -mask => '@fvwm.xbm', -position => [250, 120], -anchor => 'center', -color => 'black', -alpha => 255); -$rect2 = $zinc->add('rectangle', $view, [150, 50, 300, 300], - -linewidth => 0, -tile => $logo, - -fillcolor => 'white', -fillalpha => 90, - -filled => 1); +#$rect2 = $zinc->add('rectangle', $view, [150, 50, 300, 300], +# -linewidth => 0, -tile => $logo, +# -fillcolor => 'white', -fillalpha => 90, +# -filled => 1); $x = 100; $y = 100; for ($i = 0; $i < 1; $i++) { @@ -55,4 +57,6 @@ $zinc->translate($rect, 150, 150); #source controls.tcl # +new Controls($zinc); + MainLoop(); diff --git a/sandbox/testarc.tcl b/sandbox/testarc.tcl index 335911d..0d52f6f 100644 --- a/sandbox/testarc.tcl +++ b/sandbox/testarc.tcl @@ -1,14 +1,14 @@ #!/usr/bin/wish8.0 -f load tkzinc3.1.so -package require Img +#package require Img set top 1 -image create photo logo -file logo.gif -image create photo papier -file texture-paper.xpm -image create photo penguin -file xpenguin.png -image create photo papier -file texture-paper.xpm +#image create photo logo -file logo.gif +#image create photo papier -file texture-paper.xpm +#image create photo penguin -file xpenguin.png +#image create photo papier -file texture-paper.xpm set r [zinc .r -backcolor gray -relief sunken -render 0] pack .r -expand t -fill both @@ -20,22 +20,22 @@ set view [.r add group $top -tags "controls"] set view2 [.r add group $top] .r translate $view2 300 -200 -set arc [.r add arc $view "50 -10 200 -100" -filled t -closed t -pieslice f \ - -fillcolor "white darkslateblue 17" -gradient "50" -linewidth 1 \ - -startangle 0 -extent 120 -tile papier] -#set arc [.r add arc $view "50 -10 200 -100" -filled t -closed t -pieslice t -fillcolor "#ff0000 #00ff00 17" -gradient "50" -linewidth 0] -#.r add arc $view "60 -20 190 -90" -filled t -closed t -pieslice t -fillcolor "white darkslateblue 17" -gradient "50/180" -linewidth 1 -linecolor white -#.r rotate $arc 10 +set arc [.r add arc $view "50 -10 200 -100" -filled t -closed t -pieslice t \ + -fillcolor "white|darkslateblue" -linewidth 1 \ + -startangle 0 -extent 120] +#set arc [.r add arc $view "50 -10 200 -100" -filled t -closed t -pieslice t -fillcolor "#ff0000|#00ff00" -linewidth 0] +#.r add arc $view "60 -20 190 -90" -filled t -closed t -pieslice t -fillcolor "white|darkslateblue" -linewidth 1 -linecolor white + #set arc2 [.r clone $arc -linecolor red -firstend "8 10 5"] #.r rotate $arc2 10 #.r translate $arc2 100 -100 -.r add icon $view2 -image penguin -set cliparc [.r add arc $view2 "-100 100 100 -100" -filled t \ +#.r add icon $view2 -image penguin +set cliparc [.r add arc $view "-100 100 100 -100" -filled t \ -fillcolor tan -fillalpha 200] .r lower $cliparc -#.r rotate $cliparc 20 -.r translate $cliparc 100 -40 +#.r rotate $cliparc 20 0 0 +#.r translate $cliparc 100 -40 #.r itemconfigure $view2 -clip $cliparc - +bind .r <1> ".r rotate $cliparc [expr 3.14/3] 0 0" source "controls.tcl" diff --git a/sandbox/testrelief.tcl b/sandbox/testrelief.tcl index be28d8f..082bae8 100644 --- a/sandbox/testrelief.tcl +++ b/sandbox/testrelief.tcl @@ -1,4 +1,4 @@ -#!/usr/bin/wish -f +#!/usr/bin/wish8.0 -f load tkzinc3.1.so diff --git a/sandbox/testtext.tcl b/sandbox/testtext.tcl index f5edb9b..3a88023 100644 --- a/sandbox/testtext.tcl +++ b/sandbox/testtext.tcl @@ -1,7 +1,7 @@ #!/usr/bin/wish8.0 -f load tkzinc3.1.so -package require Img +#package require Img set mask "/usr/X11R6/include/X11/bitmaps/fvwm.xbm" diff --git a/sandbox/testzinc.pl b/sandbox/testzinc.pl index 1e4bf90..63b1b1a 100644 --- a/sandbox/testzinc.pl +++ b/sandbox/testzinc.pl @@ -382,10 +382,14 @@ $zinc->Tk::bind('<1>', [\&stick_wp]); ################################################### # creation ministrip ################################################### -#$ministrip = $zinc->add("tabular", $radar, 10, -# -labelformat => "x40x20+0+0 x40x20+40+0", -# -position => [100, 10]); -#$zinc->itemconfigure($ministrip, 0 , -text => 'ministrip'); +$ministrip = $zinc->add("tabular", $radar, 10, + -labelformat => "x80x20+0+0", + -position => [100, 10]); +$zinc->itemconfigure($ministrip, 0 , -text => 'ministrip'); +$zinc->bind($ministrip.':0', '', + sub {$zinc->itemconfigure('current', 0, -border => 'contour')}); +$zinc->bind($ministrip.':0', '', + sub {$zinc->itemconfigure('current', 0, -border => '')}); ################################################### # creation map -- cgit v1.1