GN4 main menu bars are linked to main tabs, and some GN4 context menus are linked to results.
Link between main menu bars and main tabs
A GN4 menuset is by default linked to a main tab by the MenuConfigName attribute in the TabItems section of the xxx_TabItems.xml file. The below expects that there is a menu named Ted4Main in the TED4_TABITEMS.XML.
Overriding default main menu bar assignment
You can override the default menu assignment specified in xxx_TabItems.xml, by a command that runs when you open a main tab in GN4 main application, such as:
NewTab("Ted4Articles", "Ted4Main")
This maps the main tab with the x:name Ted4Articles to the Ted4Main menu set, overriding what's specified in the MenuConfigName of the designated main tab.
See also
How GN4 menus are linked to results?
How double-click is linked to results?