hi jonathan,
you can update he bars by making them part of the handles. i attached my version of your attempt.
g.
Jonathan Wilkes:
After checking out Frank Barknecht's ds slider example, I'm trying to build a ds bar-graph that behaves like the max multi-slider, where you can click-drag to change multiple values in one mouse-swoop. In the attached patch, you can click on the red "handle" and drag across the bars to change the elements of the arrays. But I can't figure out how to resize the "bars" without using a metro to get the y-value of the handles. Is there a simpler way to do this? I tried using only one struct for both "bar" and "handle" but couldn't figure out how to get the bottom of the bars to stay constant.
Thanks, Jonathan
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
#N struct container float x float y array handles handle; #N struct handle float y; #N canvas 431 83 816 617 10; #N canvas 75 211 450 300 container 0; #X obj 82 53 struct container float x float y array handles handle array; #X obj 82 97 plot handles 0 0 0 40 23; #X restore 164 104 pd container; #N canvas 56 33 534 703 paint 1; #X scalar container 100 100 ; 38 ; 92 ; 83 ; 52 ; 54 ; 58 ; 62 ; 33 ; ;; #X coords 0 0 1 1 85 60 0; #X restore 343 139 pd paint; #X msg 404 109 clear; #X obj 404 136 s pd-paint; #N canvas 1100 4 580 348 handle 1; #X obj 98 72 struct handle float y; #X obj 98 101 filledpolygon 950 333 1 -10 -5 10 -5 10 5 -10 5 -10 -5 ; #X obj 159 141 filledpolygon 777 666 1 -10 y(-100:120)(227:7) 10 y(-100:120)(227:7) 10 8 -10 8 -10 y(-100:120)(227:7); #X restore 164 60 pd handle; #N canvas 0 22 427 343 init 0; #X obj 114 192 append container x y; #X obj 231 166 pointer; #X msg 231 140 traverse pd-paint , bang; #X obj 114 83 t b b b; #X msg 114 148 100 100; #X msg 211 85 ; pd-paint clear; #X obj 114 29 loadbang; #X obj 114 227 outlet; #X obj 61 29 inlet; #X connect 0 0 7 0; #X connect 1 0 0 2; #X connect 2 0 1 0; #X connect 3 0 4 0; #X connect 3 1 2 0; #X connect 3 2 5 0; #X connect 4 0 0 0; #X connect 6 0 3 0; #X connect 8 0 3 0; #X restore 331 230 pd init; #X obj 184 325 setsize container handles; #X obj 331 198 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X obj 373 416 element container handles; #X obj 373 441 get handle y; #X msg 184 290 8; #X text 257 196 Re-init -->; #X obj 184 258 t b; #X msg 555 144 bang; #X obj 373 323 until; #X obj 373 345 f; #X obj 402 345 + 1; #X obj 448 347 sel 0; #X obj 402 367 mod 10; #X obj 454 501 list; #X obj 448 567 list; #X text 591 142 get the list; #X obj 448 588 print Values; #X obj 373 508 list prepend; #X obj 373 301 t b b; #X msg 442 477 list; #X obj 246 290 + 1; #X obj 373 396 - 1; #X obj 574 540 unpack 0 0 0 0 0 0 0 0; #X floatatom 519 575 5 0 0 0 - - -; #X floatatom 552 575 5 0 0 0 - - -; #X floatatom 585 575 5 0 0 0 - - -; #X floatatom 618 575 5 0 0 0 - - -; #X floatatom 651 575 5 0 0 0 - - -; #X floatatom 683 575 5 0 0 0 - - -; #X floatatom 716 575 5 0 0 0 - - -; #X floatatom 749 575 5 0 0 0 - - -; #X obj 373 464 * -1; #X obj 373 483 + 100; #X connect 2 0 3 0; #X connect 5 0 6 1; #X connect 5 0 8 1; #X connect 5 0 12 0; #X connect 7 0 5 0; #X connect 8 0 9 0; #X connect 9 0 37 0; #X connect 10 0 6 0; #X connect 10 0 26 0; #X connect 12 0 10 0; #X connect 13 0 24 0; #X connect 14 0 15 0; #X connect 15 0 16 0; #X connect 16 0 18 0; #X connect 17 0 14 1; #X connect 17 0 20 0; #X connect 18 0 17 0; #X connect 18 0 15 1; #X connect 18 0 27 0; #X connect 19 0 23 1; #X connect 20 0 22 0; #X connect 20 0 28 0; #X connect 23 0 19 0; #X connect 23 0 20 1; #X connect 24 0 14 0; #X connect 24 1 25 0; #X connect 25 0 23 1; #X connect 26 0 18 1; #X connect 27 0 8 0; #X connect 28 0 29 0; #X connect 28 1 30 0; #X connect 28 2 31 0; #X connect 28 3 32 0; #X connect 28 4 33 0; #X connect 28 5 34 0; #X connect 28 6 35 0; #X connect 28 7 36 0; #X connect 37 0 38 0; #X connect 38 0 23 0;