Re: GtkTextBuffer crashes



Hi AlannY,

I'm new to this mail thread but I think that I know what your issue
is.  Basically, GTK/GDK is not designed to be called from multiple at
the same time.  Doing so causes all kinds of strange issues such as
the ones that you are seeing.  There are many ways to get around this
issue but reading the information on
http://library.gnome.org/devel/gdk/stable/gdk-Threads.html is a great
start.

In general, I find it best never to make GTK/GDK calls from any thread
other than the main thread, although it is possible.

As stated earlier, I'm new to this mail list so if anyone would like
to correct me then please go ahead.

Hope that helps,

Michael

On 15/10/2007, AlannY <m alanny ru> wrote:
AlannY wrote:
Hi there.

I have trouble in my program.

First of all, I'm using latest GTK and got many assertion in console
when using GtkTextBuffer.

Second. I have 2 threads. First one is a gtk_main_loop. Second one is my
(pthread) thread. In second thread I'm trying to set this:

gtk_text_buffer_set_text(window.buffer, "", -1);
gtk_text_buffer_get_start_iter(window.buffer, &iter);
gtk_text_buffer_insert_with_tags(window.buffer, &iter, "Some text", -1,
bold, NULL);
gtk_text_buffer_insert_at_cursor(window.buffer, "Another text", -1);

Then I got many assertions, aborts and segmentation faults:

Gtk-ERROR **: file gtktextlayout.c: line 1113 (get_style): assertion
failed: (layout->one_style_cache == NULL)
Gtk-CRITICAL **: gtk_text_layout_real_invalidate: assertion
`layout->wrap_loop_count == 0' failed

Is there any idea on how to solve this problem?
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Also I have that error:

Gtk-WARNING **: Invalid text buffer iterator: either the iterator is
uninitialized, or the characters/pixbufs/widgets in the buffer have been
modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a
position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that
can be referred to by character offset)
will invalidate all outstanding iterators
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]