MenuItem on Menu-Bar

Windows specific forum
User avatar
gurj
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

MenuItem on Menu-Bar

Post 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

my pb for chinese:
http://ataorj.ys168.com
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: MenuItem on Menu-Bar

Post by Dude »

So... what are we looking for?
User avatar
gurj
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: MenuItem on Menu-Bar

Post by gurj »

thanks,for sharing.
my pb for chinese:
http://ataorj.ys168.com
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: MenuItem on Menu-Bar

Post 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.
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
gurj
Enthusiast
Enthusiast
Posts: 658
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: MenuItem on Menu-Bar

Post by gurj »

i hope closing MenuTitle() use EndMenuTitle()
thanks !
my pb for chinese:
http://ataorj.ys168.com
Post Reply