moai.FreeObject("menRecentSearches") doesn't frees its children (items)!?

Discuss GUI programming with the RapaGUI plugin here
Post Reply
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

moai.FreeObject("menRecentSearches") doesn't frees its children (items)!?

Post by bitRocky »

I do this:

Code: Select all

  moai.DoMethod("menu", "Remove", "menRecentSearches")
  moai.FreeObject("menRecentSearches") 
to remove a menu from the menubar, but it seems that FreeObject() doesn't automatically frees the items of the menu!?
Shouldn't it also remove all its children/items?

I have to do that to free also all of its item:

Code: Select all

	For Local i=1 To RecentSearchMax
		If moai.HaveObject("itmRS"..i)
			DebugPrint("have itmRS"..i)
			moai.DoMethod("menRecentSearches", "Remove", "itmRS"..i)
			moai.FreeObject("itmRS"..i)
		Else 
			DebugPrint("dont have itmRS"..i)
		EndIf 
	Next
	moai.FreeObject("menRecentSearches")
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: moai.FreeObject("menRecentSearches") doesn't frees its children (items)!?

Post by airsoftsoftwair »

That menu stuff is complicated, please provide a full MCVE :)
Post Reply