Forums > MaxMSP

combo box

February 4, 2008 | 6:42 am

I’ve messed around with umenu but I was wondering if there is a combo box (dropdown) object that allows you to specify each items text and a different underlying value.

Thanks.


February 4, 2008 | 7:38 am

On Feb 3, 2008, at 10:42 PM, Adam Mokan wrote:
> I’ve messed around with umenu but I was wondering if there is a
> combo box (dropdown) object that allows you to specify each items
> text and a different underlying value.

I don’t think that there is, but it’s really easy implement with
something like coll. You could either use the index of the menu to
grab things out of coll, or with the restriction of not having spaces
in the menu data, you could use the symbols to look up into coll,
which has the advantage of the coll not being dependent on the order
of things in the menu.

-C


February 4, 2008 | 8:01 am

jit.celblock might be what you’re looking for. Once I implemented something similar in an lcd. The index.pat abstraction makes use of this (http://www.jvkr.nl/shelves).

_
johan


February 4, 2008 | 8:13 am

On Feb 3, 2008, at 10:42 PM, Adam Mokan wrote:

> I’ve messed around with umenu but I was wondering if there is a
> combo box (dropdown) object that allows you to specify each items
> text and a different underlying value.

If I understand correctly, I think you could use one [ubumenu] for
the visible interface, and another hidden [ubumenu] controlled by the
index of the first which would contain your list of underlying
values. You just need to keep their contents synchronized. I’ve
done this when I didn’t want to mess around with [coll].

Vlad Spears
Tanj! I’m already out of Known Space!

http://www.daevlmakr.com

http://www.2secondfuse.com


February 4, 2008 | 9:08 am

On Feb 4, 2008, at 12:13 AM, Vlad Spears wrote:

>
> On Feb 3, 2008, at 10:42 PM, Adam Mokan wrote:
>
>> I’ve messed around with umenu but I was wondering if there is a
>> combo box (dropdown) object that allows you to specify each items
>> text and a different underlying value.
>
> If I understand correctly, I think you could use one [ubumenu] for
> the visible interface, and another hidden [ubumenu] controlled by
> the index of the first which would contain your list of underlying
> values. You just need to keep their contents synchronized. I’ve
> done this when I didn’t want to mess around with [coll].

Keeping things in sync can be a pita, though. If you construct your
menu such that you can use the text as a symbol lookup into coll, you
can change the order of things in the menu without caring what order
they are stored in the coll:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 234 154 284 196617 < - data does not need to be stored in
the same order as menu;
#P newex 153 177 69 196617 route symbol;
#P message 153 228 97 196617 Thr33;
#P newex 153 205 62 196617 prepend set;
#P number 63 135 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 153 131 80 196617 prepend symbol;
#N coll menuVals 1;
#T flags 1 0;
#T store Third thing Thr33;
#T store First thing Uno;
#T store Second thing 2;
#P newobj 153 153 80 196617 coll menuVals 1;
#P user umenu 63 107 100 196647 1 64 123 1;
#X add First thing;
#X add Second thing;
#X add Third thing;
#P comment 165 108 284 196617 < - no spaces , only non-breaking spaces
(option-space);
#P connect 1 0 4 0;
#P connect 1 1 3 0;
#P connect 3 0 2 0;
#P connect 2 0 7 0;
#P connect 7 1 5 0;
#P connect 7 0 5 0;
#P connect 5 0 6 0;
#P window clipboard copycount 9;


February 4, 2008 | 9:49 pm

On Feb 4, 2008, at 1:08 AM, Chris Muir wrote:

> Keeping things in sync can be a pita, though. If you construct your
> menu such that you can use the text as a symbol lookup into coll,
> you can change the order of things in the menu without caring what
> order they are stored in the coll:

Totally. Unless I had something I knew wouldn’t change and with not
too many pairs in the lists, I’d go with your solution. Nice and
efficient patch, Chris.

Vlad

Vlad Spears
Tanj! I’m already out of Known Space!

http://www.daevlmakr.com

http://www.2secondfuse.com


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