#include ONCE "window9.bi"

sub DeleteListBoxItem(iGadget as Long , iItem as Long) export

	dim as GtkListStore ptr liststore
	
	dim as GtkTreeIter iter
	
	dim as Long iCount
	
	dim as Long iRet
	
	liststore = cast(any ptr , gtk_tree_view_get_model(cast(any ptr,GadgetId(iGadget))))	
	
	iRet = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(liststore), @iter)
	
	while iRet
		
		if iItem = iCount then
			
			gtk_list_store_remove(liststore  , @iter)
			
			exit while
			
		EndIf
		
		iCount+=1
		
		iRet = gtk_tree_model_iter_next (GTK_TREE_MODEL(liststore), @iter)
		
	Wend			
	
End Sub