gtk_text_buffer_insert_pixbuf(...) something wrong



Hi, I'm trying to use
gtk_text_buffer_insert_pixbuf... and situation looks like that : 
ofcourse it works, but not always. ex. if I want to put one small (xpm) image
in every added line, and if I do it in normal speed... is fine... but if I just try to speed up, you know one letter+enter fast, then I get messages that I attached below.

code looks like that :
        buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(history));

        gtk_text_buffer_get_end_iter(buf, &iter);

        gtk_text_buffer_insert_with_tags_by_name(buf, &iter, tmp, -1, "bold", NULL);
        gtk_text_buffer_insert_pixbuf(buf,&iter,create_pixbuf("em_beer.xpm"));
        gtk_text_buffer_insert(buf, &iter, g_strconcat(msg,"\n",NULL), -1);

        mark = gtk_text_buffer_create_mark(buf,"gg_end",&iter,FALSE);
        gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(history), mark, 0.0, TRUE, 0.5, 0.5);
        gtk_text_buffer_delete_mark_by_name(buf,"gg_end");



what did I wrong ?


warrings:

(gg2:17824): 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

(gg2:17824): Gtk-CRITICAL **: file gtktextbuffer.c: line 1230 (gtk_text_buffer_delete): assertion `gtk_text_iter_get_buffer (start) == buffer' failed

(.......................)

(gg2:17824): 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

(gg2:17824): Gtk-CRITICAL **: file gtktextbuffer.c: line 1230 (gtk_text_buffer_delete): assertion `gtk_text_iter_get_buffer (start) == buffer' failed




-- 

Marcin Krzyzanowski
www   : http://krzak.linux.net.pl
email : krzak linux net pl , krzak hakore com
IRC   : [krzyzak] @#linuxnews @#zdrowo_jebnieci



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