Re: about textview (gtk_text_buffer_insert_with_tags cause segmentaion fault)

On Tue, 2008-07-15 at 02:09 +0800, æçå wrote:
Hi all ,
When I insert some text to textview in a thread in the following code(myThread::run) . it will segmentation 
fault . 
Could someone help me to fix this issue.
Any comments and suggestion will be welcomed.


#include <gtk/gtk.h>

class myThread:public Thread
public :
    void run()
            g_print("Thread is running\n");
            //Code belowe will cause the segmentation fault
            GtkTextBuffer* tb = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tv));
            GtkTextIter end;
            gchar text[] = "Thread is running\n";
            gtk_text_buffer_insert_with_tags(GTK_TEXT_BUFFER(tb),&end,text,-1,tag);//segmentaion fault.

You should add `NULL' to the parameter list:

                &end,text,-1,tag, NULL);

gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

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