scratchfoundation / scratchx

Scratch Extension Site
https://github.com/llk/scratchx
190 stars 120 forks source link

Any way to update menus in blocks? #47

Closed davidferguson closed 1 year ago

davidferguson commented 9 years ago

I am creating a ScratchX extension, and have the code

var descriptor = { blocks: [ [' ', 'Connect to IP %m.ipSelection', 'ipConnect', 3] ], menus: { ipSelection: ['Loading IPs, please wait...'] }, };

as my descriptor object. I basically want the user to choose from a list of IP addresses to connect to.

However, my problem is that the IP addresses take a few seconds to load into my js file, and when I use the code

descriptor.menus.ipSelection = newIPs;

to try and update the menu in the block, it updates the descriptor object, but not the contents of the menu in the block.

Is there a way for me to be able to update the menu inside one of the blocks?

Thanks

bleush38p commented 9 years ago

As far as I'm aware, there's not a way to update it live. You can still remove and re-add the extension to get similar behavior. The Cookie Variables extension uses this technique, creating a very neat effect.