Submenus

Submenus, as created in , are very simple extensions to menus. The submenu itself is just a regular menu, created with text/function pairs. The calling menu, however, has buttons with the names of submenus instead of functions.
var submenu1 = menu(
    "text1",func1,
    "text2",func2,
    ...
)

var submenu2 = menu(
    "text3",func3,
    "text4",func4,
    ...
)

var mainmenu = menu (
    "text5",submenu1,
    "text6",submenu2,
    ...
)
When a button on the main menu is clicked, the submenu pops up next to it. Normally, the submenu disappears after a second click (or pushing ESC), but when you click in the top border without moving, it will turn red and stay on screen. That way, all submenus can be made visible at the same time.