aboutsummaryrefslogtreecommitdiff
path: root/test/toxy
diff options
context:
space:
mode:
Diffstat (limited to 'test/toxy')
-rw-r--r--test/toxy/lbpict-test.pd3
-rw-r--r--test/toxy/lbpict.wid7
-rw-r--r--test/toxy/testmess-test.pd35
-rw-r--r--test/toxy/testmess.wid34
-rw-r--r--test/toxy/tot-color.pd27
5 files changed, 106 insertions, 0 deletions
diff --git a/test/toxy/lbpict-test.pd b/test/toxy/lbpict-test.pd
new file mode 100644
index 0000000..b2214b6
--- /dev/null
+++ b/test/toxy/lbpict-test.pd
@@ -0,0 +1,3 @@
+#N canvas 0 0 756 516 12;
+#X obj 47 50 widget lbpict p1 #fname /usr/lib/tk8.4/demos/images/earth.gif
+;
diff --git a/test/toxy/lbpict.wid b/test/toxy/lbpict.wid
new file mode 100644
index 0000000..d7d5771
--- /dev/null
+++ b/test/toxy/lbpict.wid
@@ -0,0 +1,7 @@
+proc ::toxy::lbpict {path fname} {
+ $path config -image [image create photo -file $fname]
+}
+
+#> lbpict label
+
+::toxy::lbpict .- .#fname
diff --git a/test/toxy/testmess-test.pd b/test/toxy/testmess-test.pd
new file mode 100644
index 0000000..712cbfc
--- /dev/null
+++ b/test/toxy/testmess-test.pd
@@ -0,0 +1,35 @@
+#N canvas 235 56 752 558 12;
+#X obj 326 23 widget testmess t;
+#X obj 122 241 tow . testmess t;
+#X msg 141 113 1;
+#X msg 122 75 1 2 3 4 5 6 7 8 9 10;
+#X msg 245 113 1 2 test;
+#X floatatom 243 194 0 0 0 0 - - -;
+#X obj 14 152 testmess 20;
+#X msg 76 28 50;
+#X msg 137 28 100;
+#X msg 190 113 list;
+#X msg 14 113 set \$1 \, bang;
+#X msg 14 28 20;
+#X floatatom 14 75 5 0 0 0 - - -;
+#X obj 16 241 r lb;
+#X obj 122 194 t b a;
+#X obj 243 152 tow . testmess t;
+#X msg 16 282;
+#X msg 212 28 debug;
+#X connect 2 0 14 0;
+#X connect 3 0 14 0;
+#X connect 4 0 14 0;
+#X connect 6 0 14 0;
+#X connect 7 0 12 0;
+#X connect 8 0 12 0;
+#X connect 9 0 14 0;
+#X connect 10 0 6 0;
+#X connect 11 0 12 0;
+#X connect 12 0 10 0;
+#X connect 13 0 16 0;
+#X connect 14 0 1 0;
+#X connect 14 1 1 0;
+#X connect 15 0 5 0;
+#X connect 17 0 15 0;
+#X connect 17 0 0 0;
diff --git a/test/toxy/testmess.wid b/test/toxy/testmess.wid
new file mode 100644
index 0000000..3263fa4
--- /dev/null
+++ b/test/toxy/testmess.wid
@@ -0,0 +1,34 @@
+puts setup
+
+proc testmess_list {path target args} {
+ set sum 0
+ foreach a $args {
+ incr sum $a
+ }
+ set lb [concat [lindex $args 0]]
+ foreach a [lrange $args 1 end] {
+ lappend lb + $a
+ }
+ lappend lb = $sum
+ set [$path cget -textvariable] $lb
+ pd [concat $target _cb $sum \;]
+}
+
+proc testmess_command {path} {
+ pd [concat lb set [set [$path cget -textvariable]] \;]
+}
+
+#> testmess button
+#. -bg green -wraplength 350 -text test
+#. -command [concat testmess_command .-]
+#. @bang .- invoke
+#. @float testmess_list .- .| .#args
+#. @list testmess_list .- .| .#args
+
+puts initializer
+
+#@ new
+puts constructor
+
+#@ free
+puts destructor
diff --git a/test/toxy/tot-color.pd b/test/toxy/tot-color.pd
new file mode 100644
index 0000000..c799195
--- /dev/null
+++ b/test/toxy/tot-color.pd
@@ -0,0 +1,27 @@
+#N canvas 307 84 527 317 12;
+#X obj 20 92 tot .;
+#X msg 82 73 query winfo rgb . green;
+#X obj 20 129 unpack 0 0 0;
+#X obj 20 168 / 256;
+#X obj 95 168 / 256;
+#X obj 170 168 / 256;
+#X obj 20 276 print;
+#X obj 20 241 pack 0 0 0;
+#X obj 20 205 int;
+#X obj 95 205 int;
+#X obj 170 205 int;
+#X msg 20 22 query set cl [tk_chooseColor] .: if .($cl != "".) .(winfo
+rgb . $cl.);
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;
+#X connect 2 1 4 0;
+#X connect 2 2 5 0;
+#X connect 3 0 8 0;
+#X connect 4 0 9 0;
+#X connect 5 0 10 0;
+#X connect 7 0 6 0;
+#X connect 8 0 7 0;
+#X connect 9 0 7 1;
+#X connect 10 0 7 2;
+#X connect 11 0 0 0;