report position of item in a list when changing ?

Nov 2, 2006 at 8:30pm

report position of item in a list when changing ?

how do i know the position of an item in a list when it is changing ? right now i am thinking having only one item changing at a time , for example a slider in a multislider .

i am sure the answer is as silly as the question , but right now i am stuck ;( …..

#28493
Nov 2, 2006 at 10:49pm

you can stack up a bunch of multisliders w/ one slider, or you can parse out the list and add indices.
see patch:

#P window setfont Geneva 9.;
#P window linecount 1;
#P message 27 383 380 11337737 0 0.329268 1 0.487805 2 0.378049 3 0. 4 0.853659;
#P newex 27 333 60 11337737 prepend set;
#P newex 27 298 58 11337737 zl group 10;
#P newex 27 263 40 11337737 pack i f;
#P newex 27 205 27 11337737 t b f;
#N counter;
#X flags 0 0;
#P newobj 27 239 66 11337737 counter;
#P newex 27 140 27 11337737 t l b;
#P newex 27 180 24 11337737 iter;
#P user multiSlider 27 39 202 84 0. 1. 5 2681 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P connect 7 0 8 0;
#P connect 6 0 7 0;
#P connect 5 0 6 0;
#P connect 3 0 5 0;
#P connect 4 1 5 1;
#P connect 1 0 4 0;
#P connect 4 0 3 0;
#P connect 2 0 1 0;
#P connect 2 1 3 2;
#P connect 0 0 2 0;
#P window clipboard copycount 9;

#87536
Nov 2, 2006 at 11:10pm

#87537
Nov 3, 2006 at 3:08am

thanks for your patch JML , i ll extrapolate on that.
JLN, thanks for your answer but i am indeed resizing dynamically multisliders , that is why i cnat deal with unpacking unless i use scripting to recreate the appropriate [unpack] + number of number boxes + connections each time i change my multislider, which is doable but i rather go a “safer” route ;)

#87538
Nov 3, 2006 at 5:41am

actually remembered that Bill Orcutt’s object [change-l] does exactly what i was looking for ….

#87539

You must be logged in to reply to this topic.