[Extension Suggestion] Can anyone make an extension where there is a common block for event?

no that'll probably not work

1 Like

Why? i thought it was supposed to work, can you tell me the reason maybe it will help me to find a better solution.

The theory works, but only if you are assuming base App Inventor, and if you correctly handle the self dispatch problem. If you want to interact with any extensions that provide the ability to create components at runtime you will only get a snapshot of the available components.

3 Likes

i was able to modify the Environment and listen to the event calls and that wouldnt change any event behaviour, is there anyway to check if Symbol belongs to an event? Currently im just manually checking the names of Symbols, because incase ill need to loop around the components and there might be a problem


Not sure, but i belive so

I said use reflection to check if method has SimpleEvent annotation

1 Like

If I were building this, I would check whether the name of the symbol in question starts with "any$", which is the event signature of the any component event blocks. Generic events always attempt to fire even if the event isn't defined. You could then schedule a new runnable on the UI thread to trigger the extension's event that represents the übergeneric event. You'll want to trap on "any$ExtensionType" where ExtensionType is your extension's type otherwise you'll end up creating an infinite loop.

4 Likes

Hmm unfortunately it seems you can only listen to just event calls but you cannot access (if the event isnt dragged into the blocks section) their args as ModuleMethod isnt defined.

1 Like

Looks like someone has indeed made an extension :wink:

2 Likes

Haha a lot of effort finding what is what

4 Likes

very very useful and helpful extension . thank yoiu

1 Like