Hi all!
Does anybody know what the following GtkErrors mean and how they are triggered?
* Gtk-ERROR **: Unknown segment type:
aborting...
* IA__gtk_text_layout_get_line_display: code should not be reached
* Gtk-CRITICAL **: IA__gtk_text_buffer_insert: assertion `GTK_IS_TEXT_BUFFER (buffer)' failed
I can mention what " IA__gtk_text_buffer_insert: assertion `GTK_IS_TEXT_BUFFER (buffer)' failed" means,
but I have no idea how it is triggered.
I couldn't find anything helpful with google.
The background:
I have a very small c++ application, where three peers are connected and as a first step I would like
to print out the messages, which are sent between the peers, on a GtkTextView.
For this, I did the following:
Code:
GtkWidget *main_window;
GtkWidget *table_layout;
GtkWidget *view;
GtkTextBuffer *buffer;
GtkTextIter iter;
main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
table_layout = gtk_table_new(9,5,TRUE);
gtk_container_add(GTK_CONTAINER(main_window), table_layout);
view = gtk_text_view_new();
buffer = gtk_text_view_get_buffer((GtkTextView*)view);
gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
gtk_table_attach_defaults((GtkTable*)table_layout, (GtkWidget*)view,0,4,1,7);
gtk_widget_show_all(init_window);
In addition, the function update takes the received messages of the peers and
updates the text view. It is called by the receiver thread of the peer. The peer
and network stuff is implemented in separated classes.
Code:
void update(char* msg){
gtk_text_buffer_insert(buffer, &iter, msg, strlen(msg));
gtk_text_buffer_insert(buffer, &iter, "\n", strlen("\n"));
}
It works for a few seconds and shows the first 3 - 6 messages, after that it crashes with one of
the above listed errors.
Does anybody have an idea how this errors are triggered?
Thanks a lot!