OpenSubMenu()
Syntax
OpenSubMenu(Text$ [, ImageID])Description
Creates an empty submenu in the current menu.
Parameters
Text$ The text for the submenu.
Windows:
In the Text$ argument, you can use the special '&' character to underline a specific letter: "&File" will actually display: FileImageID (optional) An optional image to display next to the submenu. This parameter only has an effect if the current menu was created using the CreateImageMenu() or CreatePopupImageMenu() command. This value can be obtained using the ImageID() function.
Return value
None.
Remarks
It is not possible to rename an OpenSubMenu easily except with Windows which returns a menu number.
Ex:
SubMenu = OpenSubMenu ("New")
SetMenuItemText (0, SubMenu, "Open")
With Linux and macOS you will have to juggle with several menus or destroy and recreate it.
Example
If OpenWindow(0, 200, 200, 220, 100, "SubMenu Example") If CreateMenu(0, WindowID(0)) MenuTitle("Project") MenuItem(1, "Open") MenuItem(2, "Close") MenuBar() OpenSubMenu("Recent files") ; begin submenu MenuItem( 3, "C:\Autoexec.bat") MenuItem( 4, "D:\Test.txt") CloseSubMenu() ; end submenu EndIf Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow EndIf
See Also
CloseSubMenu(), MenuTitle(), MenuItem(), MenuBar()
Supported OS
All