#include Once "window9.bi"

Sub DeleteTreeViewItemAll(iGadget As Long)
	
	Dim As Any Ptr treeview = Gadgetid(iGadget)
	
	Dim As Any Ptr treestore = Cast(Any Ptr , gtk_tree_view_get_model(treeview))
	
	Dim As GtkTreeIter iter , iterDel
	
	If gtk_tree_model_get_iter_first(treestore , @iter) Then
		
		While iter.stamp
			
			iterDel.stamp = iter.stamp
			
			iterDel.user_data = iter.user_data
			
			If gtk_tree_model_iter_next(treestore, @iter) Then
				
				Deletetreeviewitem(iGadget , Cast(Integer , iterDel.user_data))
				
			Else
			
				Deletetreeviewitem(iGadget , Cast(Integer , iterDel.user_data))
				
				Exit While
				
			Endif
			
		Wend
		
	Endif
	
End Sub