void do_exit(GtkWidget *widget, gpointer txt) {
GtkTextBuffer* buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(txt));
GtkTextIter start, end;
gtk_text_buffer_get_start_iter(buf, &start);
gtk_text_buffer_get_end_iter(buf, &end);
char* dta = gtk_text_buffer_get_text(buf,&start,&end,FALSE);
printf("Text written is:\n%s\n",dta);
gtk_main_quit();
}