From a3f8c8cf22a10344864fa34c37ad056f22a97400 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Thu, 2 Oct 2003 13:08:50 +0000 Subject: *** empty log message *** --- sandbox/allgradients.tcl | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ sandbox/conical.tcl | 18 ++++++++++++++++++ sandbox/lines.pl | 16 ++-------------- sandbox/testbitmaps.tcl | 32 +++++++++++++++++++++++++++++--- sandbox/testtext.tcl | 4 ++-- sandbox/textexpand.tcl | 6 ++++++ sandbox/trash.xbm | 6 ++++++ 7 files changed, 111 insertions(+), 19 deletions(-) create mode 100644 sandbox/allgradients.tcl create mode 100644 sandbox/conical.tcl create mode 100644 sandbox/textexpand.tcl create mode 100644 sandbox/trash.xbm (limited to 'sandbox') diff --git a/sandbox/allgradients.tcl b/sandbox/allgradients.tcl new file mode 100644 index 0000000..eaab25b --- /dev/null +++ b/sandbox/allgradients.tcl @@ -0,0 +1,48 @@ + +lappend auto_path .. +package require Tkzinc + +set defaultfont -b&h-lucida-bold-r-normal-*-*-140-*-*-p-*-iso10646-1 +zinc .zinc -width 700 -height 300 -render 1 -backcolor red +pack .zinc + + +puts start +.zinc gname black|white {axial 1} +#.zinc gname {=conical 70 |white|gray20 50|white} {axial 2} +.zinc gname {=conical 70 |red|yellow 50|red} {axial 2} +.zinc gname {=axial -50 -50 50 50|black|white} {axial 3} +.zinc gname {=axial 30|black|black;0} {axial 4} +.zinc gname {=radial -50 -50 50 50|white|black} {radial 1} +.zinc gname {=radial 0 0|white;50 0 70|black 50|white 100} {radial 2} +.zinc gname {=path -14 -20|white|black;80} {path 1} +.zinc gname {=path -14 -20|white|white 30|black;80} {path 2} +puts end + +set grp [.zinc add group 1] +#.zinc add rectangle $grp {0 0 70 50} -filled 1 -fillcolor white +.zinc add rectangle $grp {0 0 200 300} -filled 1 -linewidth 1 \ + -fillcolor {axial 1} -tags rect +.zinc add text $grp -text {axial 1} -anchor center -position {35 -10} \ + -tags txt + +.zinc translate $grp 20 30 + +set i 1 +foreach s {{axial 2} {axial 3} {axial 4} {radial 1} + {radial 2} {path 1} {path 2}} { + + set grp [.zinc clone $grp] + .zinc addtag "g$grp" withtag "$grp*attrs" + .zinc itemconfigure ".$grp.txt" -text $s + .zinc itemconfigure ".$grp.rect" -fillcolor $s + incr i + + if {$i == 5} { + .zinc translate $grp [expr -3*100] 80 + set i 1 + } else { + .zinc translate $grp 100 0 + } +} + diff --git a/sandbox/conical.tcl b/sandbox/conical.tcl new file mode 100644 index 0000000..63dd7c0 --- /dev/null +++ b/sandbox/conical.tcl @@ -0,0 +1,18 @@ + +lappend auto_path .. +package require Tkzinc + +set defaultfont -b&h-lucida-bold-r-normal-*-*-140-*-*-p-*-iso10646-1 +zinc .zinc -width 700 -height 500 -render 1 +pack .zinc + + +.zinc gname {=radial 0 0 |white|gray30} test1 +.zinc gname {=conical 70 |white|gray30 50 50|white} test2 + +set grp [.zinc add group 1] +#.zinc add rectangle $grp {0 0 70 50} -filled 1 -fillcolor white +.zinc add rectangle $grp {60 60 360 360} -filled 1 -linewidth 1 \ + -fillcolor test2 -tags rect + +.zinc add rectangle $grp {140 140 280 280} -filled 1 -fillcolor gray diff --git a/sandbox/lines.pl b/sandbox/lines.pl index 794de7b..5e7fc6e 100644 --- a/sandbox/lines.pl +++ b/sandbox/lines.pl @@ -2,20 +2,8 @@ use Tk; use Tk::Zinc; - -#!/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, @@ -28,6 +16,7 @@ $zinc = $mw->Zinc(-render => 1, $zinc->pack(-expand => 1, -fill => 'both'); $zinc->configure(-width => 500, -height => 500); +print "coucou\n"; $view = $zinc->add('group', $top, -tags => "controls"); $mp3 = $zinc->add('curve', $view, [20, 280, 100, 430, 200, 430], -linewidth => 9, @@ -39,9 +28,8 @@ $mp3 = $zinc->add('curve', $view, [20, 280, 100, 430, 200, 430], -capstyle => 'round', -linecolor => 'red:100'); -new Controls($zinc); $mw->Tk::bind('

', sub { print "perfs: ", join(',', $zinc->monitor()), "\n" }); -$mw->Tk::bind('', sub { $zinc->remove($arc); }); +$mw->Tk::bind('', sub { $zinc->remove($mp3); }); $mw->Tk::bind('', sub { exit(0); }); $zinc->focusFollowsMouse(); MainLoop(); diff --git a/sandbox/testbitmaps.tcl b/sandbox/testbitmaps.tcl index 930d935..27a519b 100644 --- a/sandbox/testbitmaps.tcl +++ b/sandbox/testbitmaps.tcl @@ -1,13 +1,19 @@ #!/usr/local/bin/wish -f -load ../tkzinc3.2.so +lappend auto_path .. +package require Tkzinc +package require Img -set r [zinc .r -backcolor gray -relief sunken] +set r [zinc .r -render 1 -backcolor gray -relief sunken] set top 1 pack .r -expand t -fill both .r configure -width 500 -height 800 -.r add rectangle $top "30 50 80 100" -filled t -fillpattern AlphaStipple0 +set r [.r add rectangle $top "30 50 80 100" -filled t -fillpattern AlphaStipple0 -linewidth 1] +.r translate $r -55 -75 +.r rotate $r 45 +.r translate $r 55 75 + .r add text $top -position "50 110" -text "0" .r add rectangle $top "100 50 150 100" -filled t -fillpattern AlphaStipple1 .r add text $top -position "120 110" -text "1" @@ -58,3 +64,23 @@ for {set i 0} {$i < 22} {incr i} { .r add text $top -position "180 560" -text "AtcSymbol" \ -font "-*-lucida-bold-r-normal-*-14-*-*-*-*-*-*-*" + + +set im [image create bitmap toto -background "red" -file fvwm.xbm] +set icim [.r add icon 1 -image $im -position {0 0}] +.r rotate $icim 20 +.r scale $icim 1.2 1.2 +.r translate $icim 50 320 +#.r add icon 1 -image $im -position {300 10} +#.r add rectangle 1 {10 10 100 100} -tile $im -filled 1 +#$im configure -background red + +set icbit [.r add icon 1 -image @fvwm.xbm -position {100 400}] + +#.r bind $icbit ".r itemconfigure $icbit -color red; \ +# $im configure -file fvwm.xbm -foreground black" +#.r bind $icbit ".r itemconfigure $icbit -color black; \ +# $im configure -file trash.xbm -foreground red " + +#.r bind $icim "$im configure -background black" +#.r bind $icim "$im configure -background red" diff --git a/sandbox/testtext.tcl b/sandbox/testtext.tcl index 0d0683c..44d3d8f 100644 --- a/sandbox/testtext.tcl +++ b/sandbox/testtext.tcl @@ -1,6 +1,6 @@ -#!/usr/local/bin/wish -f +lappend auto_path .. -load ../tkzinc3.2.so +package require Tkzinc package require Img set mask "/usr/X11R6/include/X11/bitmaps/fvwm.xbm" diff --git a/sandbox/textexpand.tcl b/sandbox/textexpand.tcl new file mode 100644 index 0000000..f690281 --- /dev/null +++ b/sandbox/textexpand.tcl @@ -0,0 +1,6 @@ +zinc .z +pack .z + +proc createItem {type params} { + if 1 [concat .z add $type 1 $params] +} diff --git a/sandbox/trash.xbm b/sandbox/trash.xbm new file mode 100644 index 0000000..0370f11 --- /dev/null +++ b/sandbox/trash.xbm @@ -0,0 +1,6 @@ +#define trash_width 16 +#define trash_height 16 +static char trash_bits[] = { + 0x00, 0x01, 0xe0, 0x0f, 0x10, 0x10, 0xf8, 0x3f, 0x10, 0x10, 0x50, 0x15, + 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, 0x50, 0x15, + 0x50, 0x15, 0x10, 0x10, 0xe0, 0x0f, 0x00, 0x00}; -- cgit v1.1