#include ONCE "window9.bi"

sub ReplaceTextItemListView( iGadget As Long, iItem As Long, iSubItem As Long , sText as string) Export 
	
	if iItem = -1 orelse iSubitem = -1 then
	
		exit sub

	EndIf
	
	dim as any ptr listview = GadgetID(iGadget)
	
	dim as GtkTreeIter iter
	
	dim as any ptr model = gtk_tree_view_get_model(listview)	
	
	dim as GtkTreePath ptr path = gtk_tree_path_new_from_indices(iItem, -1)
	
	if path then
		
		gtk_tree_model_get_iter(cast(any ptr,model) , @iter , path)	
		
		if iter.stamp then
			
			gtk_list_store_set(model, @iter, iSubItem*2+1, strptr(sText),  -1)
			
		EndIf	
			
		gtk_tree_path_free(path)		
		
	EndIf
	
End sub