#include ONCE "window9.bi"

function OpenSubMenu(titleMenu as HMENU , sTitle as String) as HMENU export
	
	dim as HMENU title = gtk_image_menu_item_new_with_label(Strptr(sTitle))
	
	dim as HMENU subMenu = gtk_menu_new ()
	
	gtk_menu_item_set_submenu (GTK_MENU_ITEM (title), subMenu)
	
	gtk_menu_shell_append (GTK_MENU_SHELL (titleMenu), title)	
	
	g_object_set_data (cast(any ptr, subMenu), "menumainparent" , titleMenu)
	
	g_object_set_data (cast(any ptr, subMenu), "menuparent" , cast(any ptr,cast(integer , title)))	
	
	gtk_widget_show (title)
	
	gtk_widget_show (subMenu)
	
	return subMenu
	
End Function