#include ONCE "window9.bi"

function Create_Menu() as HMENU export 
	
	if pGlobalTypeWindow9->ListMenus  = 0 then
		
		pGlobalTypeWindow9->ListMenus = New LinList
		
		if pGlobalTypeWindow9->ListMenus = 0 then
			
			print "Allocated memory error in Create_Menu!"
			
			return 0
			
		EndIf
		
	EndIf
	
	dim as ListT ptr pListTemp
	
	dim as any ptr mainBox ,  toolbar , vBox
	
	pListTemp = cast(ListT ptr,pGlobalTypeWindow9->ListWinAndContainers->findNodeFunc(cint(pGlobalTypeWindow9->CurentHwnd)))
	
	mainBox = cast(hwnd , pListTemp->anyTwoData)
	
	dim as HMENU newMenu = gtk_menu_bar_new ()
	
	gtk_container_add (mainbox, newMenu)
	
	g_object_set_data(cast(any ptr, pGlobalTypeWindow9->CurentHwnd) , "main_menu" , newMenu )
	
	gtk_widget_show(newMenu)
	
	gtk_widget_show(mainBox)
	
	return newMenu
	
End Function 