How can I print (for example in a label) the text into a GtkTextView? For GtkLabel and GtkEntry there are gtk_label_get_text() and gtk_entry_get_text(), but for GtkTextView?
Based on doublep's answer, for quick copy/paste:
char *get_text_of_textview(GtkWidget *text_view) {
GtkTextIter start, end;
GtkTextBuffer *buffer = gtk_text_view_get_buffer((GtkTextView *)text_view);
gchar *text;
gtk_text_buffer_get_bounds(buffer, &start, &end);
text = gtk_text_buffer_get_text(buffer, &start, &end, FALSE);
return text;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With