Hi guys,
This might be a really dumb one...
I would like to print a line of text periodically to a textview, which is inside a scrolled window.
The trouble is, my program waits until all the data has been printed to the buffer before showing it, instead of printing line by line as the data becomes available.
--- code tidbits ---
GtkTextBuffer *textbuffer1;
GtkTextIter end;
gchar *text;
GtkTextIter end;
gchar *text;
text= (gchar *) g_malloc0 (100);
. . .
Loop:
memset (text, 0,
100);
sprintf (text, "some very interesting data", interesting_arguments);
textbuffer1 = gtk_text_view_get_buffer (GTK_TEXT_VIEW (data->textview1));
gtk_text_buffer_get_end_iter (textbuffer1, &end);
gtk_text_buffer_insert (textbuffer1, &end, text, -1);
gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (data->textview1), &end, 0.0, FALSE, 0, 0);
sprintf (text, "some very interesting data", interesting_arguments);
textbuffer1 = gtk_text_view_get_buffer (GTK_TEXT_VIEW (data->textview1));
gtk_text_buffer_get_end_iter (textbuffer1, &end);
gtk_text_buffer_insert (textbuffer1, &end, text, -1);
gtk_text_view_scroll_to_iter (GTK_TEXT_VIEW (data->textview1), &end, 0.0, FALSE, 0, 0);
End Loop
--- end of code ---
In my .ui file I have..
<object class="GtkTextView" id="textview1">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
Any idea what I've done wrong?
Dave
_______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx https://mail.gnome.org/mailman/listinfo/gtk-list