DisableGadgetItem doesn't work?

BlitzMax Forums/BlitzMax Programming/DisableGadgetItem doesn't work?

Black Hydra(Posted 2006) [#1]
The function DisableGadgetItem() doesn't appear to work. I'm using this code to add items and then disable them based on a conditional. Despite that a call to GadgetItemText() provides the accurate text handle, the item isn't disabled. I've tried starting with an index of 1 instead of 0 also to no avail. I've also tried selecting the gadget and then getting the selected gadget and trying to disable that, but no results. What am I missing? I was expecting the item to be greyed out but nothing has changed...

		Local n:Int = 0
		For Local A:TAction = EachIn S.ActionList
			AddGadgetItem(lstInventory, A.Name)	
			'Apply Effects
			If Not(A.Runable())
				DisableGadgetItem(lstInventory, n)
			EndIf
			n :+ 1			

		Next




neilo(Posted 2006) [#2]
It looks like you're trying to disable items within a listbox. That's probably not possible at all... certainly under Windows it isn't.

DisableGadget() works just fine for whole gadgets.

GadgetItemText() simply retrieves the text from a gadget, not a handle to a gadget item.