User defined menus using lists as menu source

In the before times, I used to use dropdown menus in custom blocks using JavaScript menus derived from Snap! lists

Could we have some sort of facility to do this again without requiring JavaScript please?

I'd like this, but I do have a question: How would this be implemented?

That would be up to Jens :slight_smile:

The simplest version would just take a simple list and provide the menu

So I have this simple menu
image

that is produced by editing options of the menu variable

If you use JavaScript code instead of the fixed text, then you can access a Snap! list instead and then generate the menu from that

One simple (too simple and kludgey probably) could be to look for something like {{{list name}} and produce the menu from that

But I'm sure Jens would come up with something a lot nicer than that :slight_smile:

FYI See this thread of what I used to do in the old days
Dropdown menus via list variables - #30 by ego-lay_atman-bay.

It would be nice, but it would still not be something that I'd expect in vanilla snap.

Does this meet your needs?


Screen Shot 2022-06-15 at 4.00.30 PM

Does that meet your need? Or, in other words, will the user make the selection while running a project? Or does the user/programmer program a choice into the project? In the latter case, this isn't quite good enough. But I'm guessing that once this is thoroughly tested and released, it'll only be incrementally harder for Jens to use the same code for menu-based formal parameters. (Supposing he's okay with the blue rounded boxes around the menus.) (And that's just a guess. :~) )

No. But I am looking forward to using that in my Mayflower MAS400 project to replace my own custom stage menus

I've implemented the new facility on a few of them just to see what they are like to use

image

I'm talking about editing dropdowns , like what I made for you for your crayons lib :slight_smile:

It would be great if the same algorithm from the UI menus was used for it