#include "window9.bi"

Sub CollapseTreeViewItem(iGadget As Long  , iItem As Integer)
	
	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 , iterfirst
	
	Dim As GtkTreePath Ptr path
	
	If gtk_tree_model_get_iter_first(treestore , @iterfirst) Then
		
		iter.stamp =  iterfirst.stamp
		
		iter.user_data = Cast(Any Ptr,iItem)
		
		path = gtk_tree_model_get_path(treestore, @iter)
		
		gtk_tree_view_collapse_row(treeview , path)
		
		gtk_tree_path_free(path)
		
	Endif
	
End Sub