#include ONCE "window9.bi"

sub MenuBackColor( menu as HMENU , iColor as Long , iFlag as Long = 0) 
	
	if menu = 0 then exit sub
	
	dim as ListT ptr pListTemp 
	
	dim as HMENU tempM  , TempM_s

	dim as GdkColor TcolorBg
	
	TcolorBg.red = cast(SHORT,((iColor and &h000000FF)shl 8) or (iColor and &h000000FF))
	
	TcolorBg.blue = cast(SHORT,((iColor and &h00FF0000) shr 8) or (iColor and &h00FF0000) shr 16)
	
	TcolorBg.green = cast(SHORT,(iColor and &h0000FF00) or (iColor and &h0000FF00) shr 8)	
	
	pListTemp = pGlobalTypeWindow9->ListMenus->firstNode
	
	while pListTemp
	
		tempM = cast(HMENU,pListTemp->anyThreeData)
		
		TempM_s = tempM
		
		do		
			
			if TempM then
				
				if TempM = menu then
					
					gtk_widget_modify_bg (TempM_s, GTK_STATE_NORMAL, @TcolorBg)
					
					exit do
					
				EndIf	
				
			else
				
				exit do
				
			EndIf
			
			tempM = g_object_get_data (cast(any ptr, tempM), "menumainparent")
			
		loop
		
		pListTemp = pListTemp->nextnode		

	Wend	
	
End Sub