aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testicon.tcl
diff options
context:
space:
mode:
authorlecoanet1999-12-09 13:16:46 +0000
committerlecoanet1999-12-09 13:16:46 +0000
commitdd871f7fd7028172b5fe86e322b0cc54a24c9e92 (patch)
treeb16af60ef6839eadd717a5478c6f7777c1bc280d /sandbox/testicon.tcl
parent3a402c2ae195749f6e5b5db5a8b5689820aa6a91 (diff)
downloadtkzinc-dd871f7fd7028172b5fe86e322b0cc54a24c9e92.zip
tkzinc-dd871f7fd7028172b5fe86e322b0cc54a24c9e92.tar.gz
tkzinc-dd871f7fd7028172b5fe86e322b0cc54a24c9e92.tar.bz2
tkzinc-dd871f7fd7028172b5fe86e322b0cc54a24c9e92.tar.xz
*** empty log message ***
Diffstat (limited to 'sandbox/testicon.tcl')
-rw-r--r--sandbox/testicon.tcl65
1 files changed, 65 insertions, 0 deletions
diff --git a/sandbox/testicon.tcl b/sandbox/testicon.tcl
new file mode 100644
index 0000000..489478c
--- /dev/null
+++ b/sandbox/testicon.tcl
@@ -0,0 +1,65 @@
+#!/usr/bin/wish -f
+
+load tkradar3.1.so
+package require Img
+
+set top 1
+
+image create photo penguin -file /usr/X11R6/include/X11/pixmaps/xpenguin_color.xpm
+set mask "/usr/X11R6/include/X11/bitmaps/fvwm.xbm"
+
+set r [radar .r -backcolor gray -relief sunken]
+pack .r -expand t -fill both
+.r configure -width 800 -height 500
+#.r configure -drawbboxes t
+.r scale $top 1 -1
+set view [.r add group $top -tags "controls"]
+
+proc maskicon {x y group mask color anchor} {
+ .r add icon $group -mask "@$mask" -position "$x $y" -anchor $anchor -color $color
+ .r add rectangle $group [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+}
+
+proc imageicon {x y group image anchor} {
+ .r add icon $group -image $image -position "$x $y" -anchor $anchor
+ .r add rectangle $group [list [expr $x - 3.0] [expr $y - 3.0] \
+ [expr $x + 3.0] [expr $y + 3.0]] -filled 1 -fillcolor red
+}
+
+set x 50.0
+set y -100.0
+maskicon $x $y $view $mask yellow sw
+set x [expr $x + 100.0]
+maskicon $x $y $view $mask pink s
+set x [expr $x + 100.0]
+maskicon $x $y $view $mask violet se
+set x 50
+set y -150
+maskicon $x $y $view $mask lightblue w
+set x [expr $x + 100.0]
+maskicon $x $y $view $mask blue center
+set x [expr $x + 100.0]
+maskicon $x $y $view $mask darkblue e
+set x 50.0
+set y -200.0
+maskicon $x $y $view $mask violet nw
+set x [expr $x + 100.0]
+maskicon $x $y $view $mask pink n
+set x [expr $x + 100.0]
+maskicon $x $y $view $mask yellow ne
+set x2 500.0
+set y2 -300.0
+imageicon $x2 $y2 $view penguin center
+
+#
+# Clip
+#
+puts "crée les clips"
+set clip [.r add rectangle $view "50 -300 600 -10" -filled t \
+ -linewidth 0 -fillcolor darkgray]
+#.r rotate $clip [expr 3.14159 / 4]
+.r lower $clip
+.r itemconfigure $view -clip $clip
+
+source controls.tcl