#include ONCE "window9.bi"

function GetSelectTextEditorGadget (iGadget as Long) as string export
	
	dim as GtkTextBuffer ptr  buffer
	
	dim as GtkTextIter  iter1, iter2
	
	buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW( gadgetid(iGadget) ))
	
	gtk_text_buffer_get_selection_bounds(buffer,@iter1,@iter2)				
	
	return *gtk_text_iter_get_text(  @iter1, @iter2  )  	
	
End Function