Forums > MaxMSP

Ubumenu autopopulate with empty first entry

January 31, 2006 | 12:31 pm

I would like to use the functionality of the ubumenu to create some nice file selectors. Only without seeing the files right away. Like what is common among some dropdowns is to have the standard selected on a white block and not on the first item.

Does this functionality exists with ubumenu or should I look towards other objects with autopopulate functionality?

Thnx


January 31, 2006 | 12:35 pm

well, jit.cellblock might be a bit better a choice, being as such that scrollbars and the ability to see multiple files at once always is probably better for files, unless space is a concern.


January 31, 2006 | 12:51 pm

I’m just fine tuning my interface. So space is of some importance. I
want to know which places I filled in already. But because you always
see the first entry and not a blank dropdown I sometimes get confused
which have already been selected.

jit.cellblock is not an option. But thnx for the suggestion.


January 31, 2006 | 12:56 pm

can you explain what you need a bit better?


January 31, 2006 | 1:06 pm

I have rows of ubumenu’s which i autopopulate to have te content of
several folders.
When you do such a thing the first file is always shown by the
ubumenu. If I haven’t selected a file from the ubumenu yet I want the
interface to be empty so that I do not see the first item of the
ubumenu.

Grtz


January 31, 2006 | 1:11 pm

well, I am not sure, but I am assuming that autopopulate is restored when you open a patch automatically, so what I would do is, encapsulate each umenu in a bpatcher and parse the folder I wanted to use as an argument with extra arguments being file types to pass through. This way, when you bang folder you can have the clear message that comes out of folder also prepend a blank index to the start of the list. Or, I think also possible to add stuff and have the index move up. Hrm, does autopopulate disable editing the contents as its refered, sort of like jit.cellblock to colls?



jln
January 31, 2006 | 1:12 pm

Couldn’t you prepend a generic name as "folder" or something. or even
"//////". Maybe not visually very nice, but you would easily know if
one sample is selected or not ?

just my two cents.

julien.


January 31, 2006 | 1:17 pm

prepend doesn’t work with ubumenu, only append.


January 31, 2006 | 1:28 pm

I could also just send an append after the autopopulate and then set
it to that value. But then I would have to check whether the selected
value is empty and then don’t process it. That seems like a basic
workaround but not a very beautiful one.


January 31, 2006 | 1:30 pm

well since autopopulate is an internal command and won’t let you access the stream of messages used to populate the menu, my suggestion is you use the "folder" object instead of autopopulate so you have control over the first message to be added to the menu.


January 31, 2006 | 1:32 pm

This is a workaround of sorts, though I would argue it’s better than a blank
list element.

This example adds a "message" list element to locate on when populating the
ubumenu then deletes the element after first use. In my example, it adds a
"Select_File" list element and locates on that.

I think this is better user interface than a blank list-element. Gives the
user some feedback on what to do.

Adam

max v2;
#N vpatcher 66 53 1132 696;
#P window setfont "Sans Serif" 9.;
#P window linecount 2;
#P user com 554 171 173 9109513 30;
#K set 0 14382 8265 17952 17993 21075 21536 21843 17708 8257 10528 21061
19791 22085 8260 21837 19801 8268 18771 21536 17740 17741 17742 21548 8258
10528 17228 20307 17696 18241 21573;
#K end;
#B color 7;
#P window linecount 3;
#P user com 511 106 147 9109513 39;
#K set 0 14126 8276 17747 21536 17999 21024 17993 21075 21536 19781 20053
8277 21317 11296 18734 17710 11296 16718 22816 21317 19525 17236 18767 20000
20308 18501 21024 21576 16718 8260 21837 19801 8268 18771 21536 17740 17741
17742 21504;
#K end;
#B color 7;
#P window linecount 2;
#P user com 754 117 147 9109513 22;
#K set 0 13870 8257 17476 8257 20036 8275 17740 17731 21536 18766 18772
18753 19488 17493 19789 22816 19529 21332 8261 19525 19781 20052;
#K end;
#B color 7;
#P window linecount 3;
#P user com 761 372 180 9109513 36;
#K set 0 18720 17231 20052 21071 19488 22344 17748 18501 21024 21576 17696
8787 17740 17731 21599 17993 19525 8736 20290 19013 17236 21280 17231 19789
21838 18755 16724 17696 22345 21576 8276 18501 8277 16981 19781 20053;
#K end;
#B color 7;
#P window linecount 1;
#P user com 930 97 100 9109513 6;
#K set 0 13614 8271 20549 20000 18241 21573;
#K end;
#B color 7;
#P user com 136 258 100 9109513 9;
#K set 0 13358 8275 17748 8272 21061 17993 22560 19791 17477;
#K end;
#B color 7;
#P window linecount 3;
#P user com 280 204 100 9109513 21;
#K set 0 13102 8234 10794 21317 21536 17999 21024 22863 21842 8260 18770
17731 21583 21081 8275 21586 21827 21589 21061 10794 10752;
#K end;
#B color 7;
#P window linecount 2;
#P user com 370 270 100 9109513 11;
#K set 0 12846 8263 17748 8257 19532 8262 18764 17696 21593 20549 21248;
#K end;
#B color 7;
#P window linecount 1;
#P newex 257 437 43 9109513 s ubu_in;
#P newex 157 317 43 9109513 s ubu_in;
#P newex 484 254 43 9109513 s ubu_in;
#P newex 791 164 43 9109513 s ubu_in;
#P newex 728 430 43 9109513 s ubu_in;
#P newex 329 492 41 9109513 r ubu_in;
#P button 291 106 15 0;
#P newex 780 53 40 9109513 b 3;
#P newex 660 98 49 9109513 strippath;
#P message 912 97 14 9109513 1;
#P newex 728 170 27 9109513 t 0 b;
#P newex 660 129 78 9109513 route Select_File;
#P newex 728 381 27 9109513 gate;
#P newex 745 240 69 9109513 prepend delete;
#P newex 745 204 27 9109513 i;
#P message 725 97 88 9109513 symbol Select_File;
#P message 819 97 87 9109513 append Select_File;
#P message 403 250 33 9109513 types;
#P newex 291 147 105 9109513 b 8;
#P message 484 209 28 9109513 clear;
#P newex 257 300 40 9109513 t s s s;
#P newex 287 380 74 9109513 prepend prefix;
#P message 157 283 74 9109513 prefix_mode 0;
#P newex 246 378 35 9109513 folder;
#P user ubumenu 329 523 140 9109513 0 1 1 0;
#X prefix_set 0 0 C:~~video:_active:_a_f: 0;
#P newex 257 274 49 9109513 tosymbol;
#P message 257 248 123 9109513 C:SubDir1:SubDir2:SubDir3;
#P window linecount 2;
#P user com 518 209 100 9109513 13;
#K set 0 12590 8259 19525 16722 8262 21071 19744 20562 17750 18767 21843
8277 21317;
#K end;
#B color 7;
#P connect 9 2 5 0;
#P connect 5 0 26 0;
#P connect 7 0 4 0;
#P connect 10 0 4 0;
#P connect 9 3 1 0;
#P connect 1 0 2 0;
#P connect 2 0 7 0;
#P connect 6 0 27 0;
#P connect 4 0 27 0;
#P connect 7 1 6 0;
#P connect 21 0 9 0;
#P connect 22 0 3 0;
#P connect 9 4 10 0;
#P connect 9 6 8 0;
#P connect 8 0 25 0;
#P fasten 3 1 19 0 399 568 543 568 543 83 665 83;
#P connect 19 0 16 0;
#P connect 20 0 12 0;
#P connect 16 1 17 0;
#P connect 18 0 15 0;
#P connect 17 0 15 0;
#P connect 15 0 23 0;
#P connect 17 1 13 0;
#P connect 13 0 14 0;
#P connect 14 0 15 1;
#P fasten 3 0 13 1 334 597 879 597 879 175 767 175;
#P fasten 9 0 20 0 296 179 240 179 240 44 785 44;
#P connect 11 0 24 0;
#P connect 12 0 24 0;
#P connect 20 1 11 0;
#P connect 20 2 18 0;
#P pop;



jln
January 31, 2006 | 1:51 pm


January 31, 2006 | 2:28 pm

You might fill it with the aid of the folder object and avoid
autopopulate. Then you can set the first element to be empty and fill
the rest.
You can also use umenu for that:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 107 116 45 196617 sel fold;
#P message 107 137 37 196617 types;
#P window linecount 2;
#P message 62 207 50 196617 clear , append;
#P window linecount 1;
#P newex 62 185 60 196617 route clear;
#P user umenu 62 243 100 196647 1 64 259 1;
#X add;
#X add "Y2K5 – Ted Killian -#12DBC9.mp3";
#X add "Y2K5 – Ted Killian -#12DBCF.mp3";
#X add "Y2K5 – Ted Killian -#12DBD8.mp3";
#X add "Y2K5 – Ted Killian -#12DBD4.mp3";
#P newex 62 162 50 196617 folder;
#P user dropfile 62 43 155 108 0;
#P comment 68 69 100 196617 drop a folder here;
#P fasten 6 0 2 0 112 158 67 158;
#P connect 4 0 5 0;
#P connect 5 0 3 0;
#P fasten 4 1 3 0 117 238 67 238;
#P connect 2 0 4 0;
#P connect 1 1 7 0;
#P connect 7 0 6 0;
#P connect 1 0 2 0;
#P window clipboard copycount 8;

[][] [][][] [][] [][][] [][] [][][] [][] [][][]
[][][][][][][][][][][][][][][][][][][][][][][][][][][][]

Stefan Tiedje
Klanggestalter
Electronic Composition
&
Improvisation

/~~~~~
\ /|() ()|
))))) )| | |( \
/// _/)/ )))))
___/ ///

————————-x—
–_____———–|———-
–(_|_ —-|—–|—–()—
– _|_)—-|—–()———-
———-()————x—-

14, Av. Pr. Franklin Roosevelt, 94320 Thiais, France
Phone at CCMIX +33-1-49 77 51 72


January 31, 2006 | 3:48 pm

how about a hack based on colors?
set the text color same as background color, and first time something gets
out of the menu, put text color back again:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 115 46 45 9109513 loadbang;
#P button 156 181 15 0;
#P newex 115 200 51 9109513 onebang 1;
#P message 115 90 79 9109513 frgb 187 187 187;
#P message 47 90 64 9109513 frgb 31 31 31;
#P user ubumenu 115 128 100 9109513 0 1 1 0;
#X setrgb 187 187 187 187 187 187 234 234 234 4 4 4 141 141 141 112 112 112;
#X add item1;
#X add item2;
#X add item3;
#X add item4;
#X add item5;
#X prefix_set 0 0 0;
#P fasten 3 0 1 0 120 228 35 228 35 72 52 72;
#P connect 5 0 2 0;
#P connect 4 0 3 1;
#P connect 0 0 3 0;
#P fasten 1 0 0 0 52 117 120 117;
#P connect 2 0 0 0;
#P window clipboard copycount 6;


February 1, 2006 | 11:38 am

But if you want to select it only one time you can’t really read it that well..


February 1, 2006 | 3:28 pm

well, i’ve said it’s just a hack, but i’m sure you are able to adjust
colors(through inspector, for instance) to achieve higher contrast.

nesa


Viewing 16 posts - 1 through 16 (of 16 total)