Page 1 of 1

MenuItem on Menu-Bar

Posted: Thu Feb 09, 2017 12:44 pm
by gurj
ok:

Code: Select all

If OpenWindow(0, 0, 0, 400, 300, "MenuItem on Menu-Bar", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_MaximizeGadget)
 If CreateMenu(0, WindowID(0))
  MenuItem(1, "1")
  
  MenuTitle("a>")
  MenuItem(2, "2")
  MenuItem(3, "3")
  
  MenuTitle("b>")
  MenuItem(4, "4")
  MenuItem(5, "5")
 ;********
CloseSubMenu()
MenuItem(6, "6");as MenuItem(1, "1")
 ;********
  MenuTitle("c>")
  MenuItem(7, "7")
  MenuItem(8, "8")

 EndIf
 Repeat :a=WaitWindowEvent()
  If a=#PB_Event_Menu:Debug EventMenu():EndIf
 Until a=#PB_Event_CloseWindow
EndIf


Re: MenuItem on Menu-Bar

Posted: Thu Feb 09, 2017 1:04 pm
by Dude
So... what are we looking for?

Re: MenuItem on Menu-Bar

Posted: Thu Feb 09, 2017 3:15 pm
by gurj
thanks,for sharing.

Re: MenuItem on Menu-Bar

Posted: Thu Feb 09, 2017 3:31 pm
by TI-994A
gurj wrote:

Code: Select all

;NO CONTAINER
MenuItem(1, "1")
  
MenuTitle("a>")   ;--> CONTAINER
MenuItem(2, "2")
MenuItem(3, "3")
The MenuTitle() object acts as a container for the MenuItem() objects. Without a menu title, menu items are added to the menu bar.

Re: MenuItem on Menu-Bar

Posted: Thu Feb 09, 2017 4:44 pm
by gurj
i hope closing MenuTitle() use EndMenuTitle()
thanks !