#include ONCE "window9.bi"

sub RenameItemTreeView(iGadget as Long , iItem as Integer , sText as string) export
	
	dim as any ptr treeview = GadgetID(iGadget)
	
	if treeview = 0 then exit sub
	
	dim as any ptr model
	
	dim as GtkTreeIter iter , iterfirst		
	
	model =  gtk_tree_view_get_model(treeview)	
	
	if gtk_tree_model_get_iter_first(model , @iterfirst) then
		
		iter.stamp =  iterfirst.stamp
		
		iter.user_data = cast(any ptr,iItem)
		
		gtk_tree_store_set(model, @iter, 1, strptr(sText),  -1)
		
	EndIf
	
End sub