Can I apply #PB_Any to menus also?
http://www.purebasic.fr/english/viewtop ... 13&t=41118
I eventually want to programmatically create my menus using DataSections and Read.s. Looks like I must predefine the MenuItem IDs.
Converting some apps from VB6 and I have over 150 menu items in some.
Is the #PB_Any behavior below correct?
It seems to just report a #True condition instead of a unique Gadget/Menu ID?
Code: Select all
If OpenWindow(0, 50, 50, 200, 50, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
If CreateMenu(0, WindowID(0))
r1 = MenuTitle("&File")
r2 = MenuItem(#PB_Any, "&Open")
r3 = MenuItem(#PB_Any, "Close")
r4 = MenuBar()
MenuItem(#PB_Any, "Exit")
MenuBar()
MenuItem(#PB_Any, "Really Exit!")
OpenSubMenu("SubMenu")
EndIf
EndIf
Debug r1
Debug r2
Debug r3
Debug r4
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
