diff options
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/local.pl | 218 | ||||
-rw-r--r-- | sandbox/local.tcl | 48 | ||||
-rw-r--r-- | sandbox/testbezier.pl | 6 |
3 files changed, 3 insertions, 269 deletions
diff --git a/sandbox/local.pl b/sandbox/local.pl deleted file mode 100644 index e97d7d5..0000000 --- a/sandbox/local.pl +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/perl -w - -use Tk; -use Tk::Zinc; -use Controls; -use Tk::Photo; -#require Tk::PNG; - -$mw = MainWindow->new(); -$logo = $mw->Photo(-file => "logo.gif"); -$papier = $mw->Photo(-file => "texture-paper.xpm"); -#$penguin = $mw->Photo(-format => 'png', -# -file => "xpenguin.png"); - -$top = 1; -$zinc = $mw->Zinc(-render => 1, - -borderwidth => 5, - -highlightthickness => 0, - -relief => 'sunken', - -takefocus => 1, -# -tile => $papier - ); -$zinc->pack(-expand => 1, -fill => 'both'); -$zinc->configure(-width => 500, -height => 500); -$gr1 = $zinc->add('group', $top); -#$clip = $zinc->add('rectangle', $gr1, [50, 50, 399, 399], -$clip = $zinc->add('arc', $gr1, [50, 50, 399, 399], - -visible => 1, - -filled => 1, - -fillcolor => 'Pink:40', -# -fillpattern => 'AlphaStipple4', - -linewidth => 0); -#$zinc->itemconfigure($gr1, -clip => $clip); -$gr2 = $zinc->add('group', $gr1); - -$clip2 = $zinc->add('rectangle', $gr2, [200, 200, 450, 300], - -visible => 1, - -filled => 1, - -fillcolor => '#70C5C0:15', -# -fillcolor => 'white:100|white:0', -# -fillcolor => '#ffffff:15 0|#ffff00:15 50|#000000:15 100/270', -# -fillcolor => 'white 0 |blue 20|blue 80|black:0 100/270', -# -linewidth => 3, - -linewidth => 11, -# -linestyle => 'dashed', - -linecolor => 'red'); - -#$zinc->itemconfigure($gr2, -clip => $clip2); -$view = $zinc->add('group', $gr2, -tags => "controls"); -$zinc->lower($clip); -$zinc->lower($clip2); - -new Controls($zinc); - -$rect2 = $zinc->add('rectangle', $view, [150, 50, 300, 300], - -visible => 0, - -linewidth => 0, - -tile => $logo, - -fillcolor => 'white:50', - -filled => 1); - -$rect = $zinc->add('rectangle', $view, [100, 100, 200, 200], - -visible => 1, - -linewidth => 3, -# -linewidth => 4, - -linecolor => 'tan', -# -fillcolor => 'pink:50', - -fillcolor => 'tan', - -relief => 'sunken', - -filled => 1 - ); -$mp = $zinc->add('curve', $view, [50, 150, 100, 250, 270, 170, - 220, 100, 200, 100, 180, 0, - 140, 140, 70, 0], - -visible => 0, - -composescale => 1, - -composerotation => 1, - -linewidth => 3, -# -linewidth => 4, - -relief => 'sunken', - -closed => 1, - -joinstyle => 'round', - -linecolor => 'black:50', - -filled => 1, - -fillcolor => 'white|black[100 100', -# -fillcolor => 'white', -# -fillpattern => 'AlphaStipple8', -# -tile => $papier, - -marker => '', - -markercolor => 'red'); -#$zinc->itemconfigure($gr1, -clip => $mp); - -$mp2 = $zinc->add('curve', $view, [0, 320, 80, 470, 200, 470], - -visible => 1, - -linewidth => 20, - -closed => 0, - -joinstyle => 'round', - -capstyle => 'round', - -linestyle => 'mixed', - -linecolor => 'red:50', - -filled => 0, -# -fillcolor => 'white|black(10 10', - -fillcolor => 'wheat', -# -fillpattern => 'AlphaStipple8', -# -tile => $papier, - -marker => 'AtcSymbol6', - -markercolor => 'black'); -$mp3 = $zinc->add('curve', $view, [20, 280, 100, 430, 200, 430], - -linewidth => 11, -# -linewidth => 9, - -closed => 0, -# -linestyle => 'dashed', - -joinstyle => 'round', - -firstend => [3, 12, 8], - -lastend => [12, 12, 8], - -capstyle => 'round', - -linecolor => 'red:100', - -filled => 1); - -$zinc->add('reticle', $view, - -visible => 1, - -position => [300, 300], - -firstradius => 60, - -stepsize => 30, -# -numcircles => 7, - -linecolor => 'gray30', - -brightlinecolor => 'gray100', -# -brightlinestyle => 'mixed' - ); - -$x = 100; -$y = 20; -for ($i = 0; $i < 100; $i++) { - $x = $x+5; - $y = $y+7; - $zinc->add('text', $view, - -visible => 1, - -text => "BlaBla et tout et tout, bref...", - -position => [$x, $y], -anchor => 'nw', - -color => 'red:30'); -} -#$peng = $zinc->add('icon', $view, -# -visible => 1, -# -image => $penguin, -position => [300, 300], -# -anchor => 'center', -# -color => 'black:50'); - -$fvwm = $zinc->add('icon', $top, - -visible => 1, - -mask => '@fvwm.xbm', - -position => [50, 20], - -anchor => 'center', - -color => 'orange:100'); - -#$zinc->gname('white 0 80|black[0 0', 'cone'); -$zinc->gname('white:50 0 80|black 50|white 100(0 0', 'oeil'); -$zinc->gname('white:100|black:100(-20 -15', 'boule'); -$zinc->gname('white:100|black:100(-15 -100', 'arrondi'); -$zinc->gname('white:100|black:100/45', 'cyl'); -$arc = $zinc->add('arc', $view, [-45, -45, 45, 45], - -visible => 1, - -fillcolor => 'boule', - -linewidth => 1, - -filled => 1, -# -startangle => 0, -# -extent => 360, - -closed => 1, -# -firstend => [12, 12, 8], -# -lastend => [12, 12, 8], -# -tile => $logo, - -pieslice => 0 - ); - -$zinc->add('rectangle', $view, [100, 100, 200, 200], - -fillcolor => 'cyl', - -linewidth => 1, - -filled => 1, - -visible => 0 - ); - -$zinc->translate($arc, 125, 300); - -#$arc2 = $zinc->add('arc', $view, [-65, -35, 65, 35], -# -fillcolor => 'black|white(0 0', -# -linewidth => 1, -# -filled => 1); -#$zinc->translate($arc2, 125, 55); - -#$zinc->raise($fvwm); - -$tab = $zinc->add('tabular', $view, 10, - -position => [300, 300], - -labelformat => '100x50'); -$zinc->itemconfigure($tab, 0, - -visible => 0, -# -image => $logo, - -text => 'blabla', - -font => "cenapii-digistrips-b12", - -border => ['contour'], - -bordercolor => 'tan', - -filled => 1, - -tile => $papier, - -reliefthickness => 4, - -relief => 'sunken', - -backcolor => 'tan'); -$zinc->raise($tab); - -$zinc->translate($rect, -150, -150); -$zinc->rotate($rect, 35); -$zinc->translate($rect, 150, 150); - -$zinc->monitor(1); -$mw->Tk::bind('<p>', sub { print "perfs: ", join(',', $zinc->monitor()), "\n" }); -$mw->Tk::bind('<t>', sub { $zinc->remove($arc); }); -$mw->Tk::bind('<q>', sub { exit(0); }); -$zinc->focusFollowsMouse(); - -MainLoop(); diff --git a/sandbox/local.tcl b/sandbox/local.tcl deleted file mode 100644 index 0033f47..0000000 --- a/sandbox/local.tcl +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/wish8.0 -f - -load tkzinc3.1.so -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 bouton -file bouton.xpm -image create photo bois -file texture-bois1.xpm - -set r [zinc .r -relief sunken -render 1] -pack .r -expand t -fill both -.r configure -width 500 -height 500 -set gr1 [.r add group $top] -set clip [.r add rectangle $gr1 "50 50 399 399" -filled 1 -fillcolor pink -linewidth 0] -#.r itemconfigure $gr1 -clip $clip -set gr2 [.r add group $gr1] -set clip2 [.r add rectangle $gr2 "200 200 450 450" -filled 1 -fillcolor lavender -linewidth 0] -#.r itemconfigure $gr2 -clip $clip2 -set view [.r add group $gr2 -tags "controls"] -.r lower $clip -.r lower $clip2 - -set rect [.r add rectangle $view "100 100 200 200" -linewidth 4 \ - -tile papier -fillcolor pink -fillalpha 128 -filled 1] -set fvwm [.r add icon $view -mask "@fvwm.xbm" -position "250 120" \ - -anchor center -color black -alpha 255] -set rect2 [.r add rectangle $view "150 50 300 300" -linewidth 0 \ - -tile logo -fillcolor white -fillalpha 90 -filled 1] -set x 100 -set y 100 -for {set i 0} {$i < 50} {incr i} { - set x [expr $x+3] - set y [expr $y+3] - .r add text $view -text "BlaBla et tout et tout, bref..."\ - -position "$x $y" -anchor nw -color red -alpha 90 -} -set peng [.r add icon $view -image penguin -position "300 300" \ - -anchor center -alpha 128] -.r translate $rect -150 -150 -.r rotate $rect 35 -.r translate $rect 150 150 - -source controls.tcl -#
\ No newline at end of file diff --git a/sandbox/testbezier.pl b/sandbox/testbezier.pl index 33297da..82948fc 100644 --- a/sandbox/testbezier.pl +++ b/sandbox/testbezier.pl @@ -98,14 +98,14 @@ foreach $current (@show) { ($cap, $filled, $border, $relief, $title) = @{$current}; $grp = $zinc->clone($model); $zinc->translate($grp, $col * 240, $row * (-290 - (2 * $lw))); - $zinc->itemconfigure($zinc->find('withtag', 'bezier', $grp), + $zinc->itemconfigure($zinc->find('withtag', "$grp*bezier"), -capstyle => $cap, -filled => $filled, -linewidth => $border ? $lw : 0, -relief => $relief, -linecolor => $relief eq 'flat' ? 'yellow' : 'tan'); - $zinc->itemconfigure($zinc->find('withtag', 'title', $grp), - -text => $title); + $zinc->itemconfigure($zinc->find('withtag', "$grp*title"), + -text => $title); $col++; if ($col >= 4) { $col = 0; |