DCollapsibleCategory Problem...

Let’s say I have a set of DCollapsibleCategories - does anyone know of a way of making only one of them be maximised at a time? My attempt is shown below, but it doesn’t work. Basically, a way of causing clicking any of the categories to make them all minimised, except for that one.


for k,v in pairs( ModelCollapsibleCategories ) do
	v[1].OnMousePressed = function()
			for m,n in pairs(ModelCollapsibleCategories) do
				n[1]:SetExpanded( 0 )
			end
			v[1]:SetExpanded( 1 )
			ActiveCategory = k
				end
	end

v[1]/n[1] are the Collapsible Category objects.

Never mind, I’ve got it working. For reference (if anyone wants to know the answer to the problem, I did this:


for k,v in pairs( ModelCollapsibleCategories ) do
	v[1].Header.OnMousePressed = function()
		for m,n in pairs(ModelCollapsibleCategories) do
			if n[1]:GetExpanded() then
				n[1]:Toggle()
			end
		end
		if !v[1]:GetExpanded() then
			v[1]:Toggle()
		end
		RunConsoleCommand( "sbep_door_activecat", k )
	end
end