Generic Events

74 views
Skip to first unread message

José Manuel Ortiz Ruiz

unread,
May 16, 2019, 7:12:27 AM5/16/19
to MIT App Inventor Forum
Hello Everyone.


Does anybody know where can I find the documentation on generic events blocks that were released in the latest version (nb176)?

I'm trying to figure out how does the notAlreadyHandled property works, and so far I have been unable to find anything.

Thanks.

SteveJG

unread,
May 16, 2019, 8:57:28 AM5/16/19
to MIT App Inventor Forum
Here is what MIT provided:    https://docs.google.com/document/d/e/2PACX-1vTn1utPFg6G6uatIW6ZK-exmFsdTLEHPQ-ODwLWc5vguwh9M8L9Xc8yN-qWteh_8VPS7QCLtKSKYlkX/pub  

The generic blocks are part of the Anycomponent Blocks.  There is a small example.   The blocks will appear in the Any component bin if a corresponding regular component is placed on the Designer screen.  For example, you will be able to use generic Button Blocks only if you place a regular Button on the Designer.



Regards,
Steve

Evan Patton

unread,
May 16, 2019, 9:14:27 AM5/16/19
to MIT App Inventor Forum
Hi José,

The notAlreadyHandled parameter will be true if no event handler of the same name is defined for the component and false otherwise.

For example: Place a bunch of buttons on a screen and create an any Button.Click event handler. When you click any of the buttons notAlreadyHandled will be true. Now, if you add a when Button1.Click event block to the workspace and click Button1, notAlreadyHandled will be false because of the presence of the Button1.Click event. Other buttons will still report true because they have no corresponding event block. This allows you to mix events for specific components and the generic events, and to be able to customize the logic in the generic handler depending on whether it was handled elsewhere.

Cheers,
Evan

P.S. Based on your comment I went back to our website to look for the any component block documentation, and it seems like we never properly documented this. We will work to correct this oversight.

José Manuel Ortiz Ruiz

unread,
May 16, 2019, 9:52:51 AM5/16/19
to MIT App Inventor Forum
Nice feature.

Thank you very much, that helps a lot.

ABG

unread,
May 16, 2019, 11:48:38 AM5/16/19
to MIT App Inventor Forum


On Thursday, May 16, 2019 at 7:12:27 AM UTC-4, José Manuel Ortiz Ruiz wrote:
Reply all
Reply to author
Forward
0 new messages