#include ONCE "window9.bi"

sub SetSelectManyItem( iGadget as Long , iStart as Long , iFinish as Long , iFlag as long = 1) export

	dim as GtkWidget ptr listbox = GadgetId(iGadget)
	
	dim as GtkTreeSelection ptr selection = gtk_tree_view_get_selection (cast(any ptr,listbox))
	
	dim as GtkTreePath ptr path_begin , path_end
	
	path_begin = gtk_tree_path_new_from_indices(iStart, -1)
	
	path_end = gtk_tree_path_new_from_indices(iFinish, -1)
	
	if iFlag = 1 then
	
		gtk_tree_selection_select_range (selection , path_begin , path_end)
	
	elseif iFlag = 0 then
		
		gtk_tree_selection_unselect_range (selection , path_begin , path_end)

	EndIf

	gtk_tree_path_free(path_begin)
	
	gtk_tree_path_free(path_end)		

End Sub