Re: Cant get GtkTextBuffer from GtkTextView widget



Ð ÐÐÐ, 14/04/2008 Ð 09:59 +0300, Tiberius DULUMAN ÐÐÑÐÑ:
The handler should be:

static void handler(GtkWidget *widget, GtkTextView *tview)
{
    GtkTextBuffer *buffer = NULL;
    GtkTextIter iterator;

    buffer = gtk_text_view_get_buffer(tview);
    g_assert(buffer != NULL);             <<< assert that it is not null
    gtk_text_buffer_get_end_iter(buffer, &iterator);   <<< pass an allocated
iterator
    gtk_text_buffer_insert(buffer, &iterator, "Info message", -1);
}

Thanks, it helps me.

-- 
If you think of MS-DOS as mono, and Windows as stereo,
 then Linux is Dolby Digital and all the music is free...



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