blob: 56c9b81deef423e53006e9b69e0e9c2dea57fddf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
|
#N canvas 178 98 493 398 10;
#X obj 136 290 sys_gui;
#X symbolatom 254 206 0 0 0 0 - - -;
#X obj 241 145 loadbang;
#X msg 136 260 \$2 configure -background \$1;
#X obj 136 231 pack symbol symbol;
#X obj 86 64 colorpanel;
#X obj 67 356 pddp/pddplink http://tcl.tk/man/tcl8.5/TkCmd/canvas.htm
;
#X text 34 330 for more options:;
#N canvas 685 90 416 325 generate 0;
#X obj 81 23 inlet;
#X obj 82 262 outlet;
#X obj 83 66 unpack float float float;
#X obj 83 90 * 255;
#X obj 83 113 int;
#X obj 83 136 makefilename %x;
#X obj 183 90 * 255;
#X obj 183 113 int;
#X obj 183 136 makefilename %x;
#X obj 283 90 * 255;
#X obj 283 113 int;
#X obj 283 136 makefilename %x;
#X obj 83 171 pack symbol symbol symbol;
#X obj 83 195 zexy/makesymbol #%s%s%s;
#X connect 0 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 6 0;
#X connect 2 2 9 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 12 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 8 0 12 1;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 11 0 12 2;
#X connect 12 0 13 0;
#X connect 13 0 1 0;
#X restore 86 85 pd generate web color;
#X obj 86 20 bng 35 250 50 0 empty empty empty 17 7 0 10 -204786 -1
-1;
#X symbolatom 106 113 10 0 0 0 - - -;
#X obj 198 293 print;
#X obj 241 182 canvas_name;
#X msg 138 143 grey;
#X msg 148 162 white;
#X msg 158 183 pink;
#X msg 162 205 black;
#N canvas 660 76 459 460 get 0;
#X symbolatom 42 225 0 0 0 0 - - -;
#X obj 42 204 canvas_name;
#X obj 42 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X symbolatom 126 225 0 0 0 0 - - -;
#X obj 126 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#N canvas 0 22 450 300 subname 0;
#X obj 117 21 inlet;
#X obj 119 265 outlet;
#X obj 107 137 canvas_name;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 126 204 pd subname;
#X symbolatom 209 225 0 0 0 0 - - -;
#X obj 209 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X symbolatom 73 118 0 0 0 0 - - -;
#X obj 73 74 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X text 47 26 You can get the canvas name of other patches that this
one is embedded in by setting the argument to the level:;
#X obj 73 97 canvas_name 1;
#X text 78 137 ^-- this is the same as the top level of this help patch
;
#X symbolatom 299 225 0 0 0 0 - - -;
#X obj 299 181 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X text 43 268 some more examples:;
#X text 35 308 get the canvas name using a float message representing
depth;
#X obj 94 363 canvas_name;
#X symbolatom 93 389 10 0 0 0 - - -;
#X msg 78 335 0;
#X msg 108 335 1;
#N canvas 0 22 450 300 open 0;
#N canvas 511 55 450 300 open 0;
#X obj 131 37 inlet;
#X obj 129 109 outlet;
#N canvas 772 55 450 300 open 0;
#X obj 131 37 inlet;
#X obj 129 109 outlet;
#N canvas 0 22 450 300 open 0;
#X obj 141 47 inlet;
#X obj 139 119 outlet;
#X obj 143 84 canvas_name;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 128 76 pd open me;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 129 74 pd open me;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 138 87 pd open me;
#X obj 141 47 inlet;
#X obj 139 119 outlet;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X restore 260 382 pd open me;
#N canvas 496 269 450 300 get_parent 0;
#X obj 117 21 inlet;
#X obj 119 265 outlet;
#X obj 109 137 canvas_name 1;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 209 204 pd get_parent;
#N canvas 496 269 450 300 get_parent_of_parent 0;
#X obj 117 21 inlet;
#X obj 119 265 outlet;
#X obj 109 137 canvas_name 2;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X restore 299 204 pd get_parent_of_parent;
#N canvas 169 157 481 329 get-from-parent 0;
#X symbolatom 114 120 0 0 0 0 - - -;
#X obj 101 96 canvas_name 1;
#X symbolatom 119 205 0 0 0 0 - - -;
#X obj 84 66 loadbang;
#X obj 106 181 canvas_name 0;
#X symbolatom 43 204 0 0 0 0 - - -;
#X obj 30 180 canvas_name;
#N canvas 0 22 450 300 add 0;
#X symbolatom 175 224 0 0 0 0 - - -;
#X obj 162 200 canvas_name 1;
#X symbolatom 264 224 0 0 0 0 - - -;
#X obj 251 200 canvas_name 2;
#X symbolatom 85 224 0 0 0 0 - - -;
#X obj 175 101 loadbang;
#X obj 72 200 canvas_name 0;
#X text 59 28 Now 0 is this subpatch \, 1 is the "pd get from parent"
subpatch that this subpatch is in \, and 2 is the "canvas_name-help.pd"
patch.;
#X connect 1 0 0 0;
#X connect 3 0 2 0;
#X connect 5 0 1 0;
#X connect 5 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
#X restore 164 267 pd add another level;
#X text 31 14 Following the interface of [getdir] and others \, you
can get the canvas name from parent patches by using a float to represent
how many levels up you want to get:;
#X text 36 237 To see it in action with a 2nd level \, check this subpatch:
;
#X text 189 204 <-- these two are the same since Pd inits to 0;
#X text 187 119 <-- this gets the canvas name from the parent;
#X connect 1 0 0 0;
#X connect 3 0 1 0;
#X connect 3 0 4 0;
#X connect 3 0 6 0;
#X connect 4 0 2 0;
#X connect 6 0 5 0;
#X restore 183 267 pd get-from-parent;
#X symbolatom 260 406 10 0 0 0 - - -;
#X obj 260 338 hradio 15 1 0 8 empty empty empty 0 -8 0 10 -262144
-1 -1 0;
#X floatatom 271 360 5 0 0 0 - - -;
#X msg 139 335 2;
#X text 121 429 .x0.c means a non-existant canvas;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 5 0;
#X connect 5 0 3 0;
#X connect 7 0 22 0;
#X connect 9 0 11 0;
#X connect 11 0 8 0;
#X connect 14 0 23 0;
#X connect 17 0 18 0;
#X connect 19 0 17 0;
#X connect 20 0 17 0;
#X connect 21 0 25 0;
#X connect 22 0 6 0;
#X connect 23 0 13 0;
#X connect 26 0 21 0;
#X connect 26 0 27 0;
#X connect 28 0 17 0;
#X restore 265 51 pd get from different levels;
#N canvas 196 75 460 490 get 0;
#X symbolatom 77 428 0 0 0 0 - - -;
#X symbolatom 72 176 0 0 0 0 - - -;
#X obj 72 132 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 220 77 namecanvas myname;
#X symbolatom 73 99 0 0 0 0 - - -;
#X obj 73 55 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 73 78 canvas_name myname;
#X text 53 14 You can also use the canvas receive symbol to get the
canvas_name:;
#X obj 77 407 canvas_name;
#X msg 129 376 pd-canvas_name-help.pd;
#X symbolatom 71 275 0 0 0 0 - - -;
#X obj 71 229 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 71 254 canvas_name pd-canvas_name-help.pd;
#X text 65 213 this help patch:;
#X text 49 302 or via the inlet:;
#N canvas 0 22 450 300 getmyname 0;
#X restore 250 155 pd getmyname;
#X obj 72 155 canvas_name pd-getmyname;
#X msg 79 351 myname;
#X msg 64 325 symbol this_does_not_exist;
#X msg 129 351 symbol pd-getmyname;
#X text 91 459 .x0.c means a non-existant canvas;
#X connect 2 0 16 0;
#X connect 5 0 6 0;
#X connect 6 0 4 0;
#X connect 8 0 0 0;
#X connect 9 0 8 0;
#X connect 11 0 12 0;
#X connect 12 0 10 0;
#X connect 16 0 1 0;
#X connect 17 0 8 0;
#X connect 18 0 8 0;
#X connect 19 0 8 0;
#X restore 265 76 pd get by canvas receive symbol;
#N canvas 410 155 494 344 META 0;
#X text 12 125 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.;
#X text 12 25 LICENSE GPL v3;
#X text 12 105 AUTHOR Hans-Christoph Steiner;
#X text 12 45 DESCRIPTION get canvas id;
#X text 12 65 INLET_0 bang;
#X text 12 85 OUTLET_0 symbol;
#X text 12 5 KEYWORDS control canvas_op;
#X restore 430 366 pd META;
#X connect 2 0 12 0;
#X connect 3 0 0 0;
#X connect 3 0 11 0;
#X connect 4 0 3 0;
#X connect 5 0 8 0;
#X connect 8 0 10 0;
#X connect 8 0 4 0;
#X connect 9 0 5 0;
#X connect 12 0 1 0;
#X connect 12 0 4 1;
#X connect 13 0 4 0;
#X connect 14 0 4 0;
#X connect 15 0 4 0;
#X connect 16 0 4 0;
|