Some codes that I would like to add (a pop up Menu) to the Inventor

I understand that you are trying to create an ai2 app made in Kodular?
Ai2 does not have a Menu component. You must use some kind of extension to create the menu.

To create a TitleBar, add a horizontal arrangement to the top of the screen. You can add an image to it to display an icon, Label to display the name of the app, and a button to open the menu with it.

You can create a menu with this extension:

See also this:

https://ai2.metricrat.co.uk/guides/who-needs-a-sidebar-anyway