combo box

audiohijack's icon

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.

Chris Muir's icon

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

jvkr's icon

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

Vlad Spears's icon

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!

Chris Muir's icon

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:

Max Patch
Copy patch and select New From Clipboard in Max.

Vlad Spears's icon

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!