#include ONCE "window9.bi"

function MenuTitle(menu as HMENU , sTitle as string) as HMENU export
	
	dim as HMENU title = gtk_menu_item_new_with_label(Strptr(sTitle))
	
	dim as HMENU titleMenu = gtk_menu_new ()
	
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (title), titleMenu)
	
	gtk_menu_shell_append (GTK_MENU_SHELL (menu), title)
	
	g_object_set_data (cast(any ptr, titleMenu), "menumainparent" , menu)
	
	g_object_set_data (cast(any ptr, titleMenu), "menuparent" , cast(any ptr,cast(integer , title)))
	
	gtk_widget_show(title)
	
	gtk_widget_show(titleMenu)
	
	return titleMenu
	
End Function