GtkTextBuffer, insert_text



Hi all
i have a small problem

i have a textbuffer

  contents = gtk_text_view_new ();
  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (contents));
        /* Implementing undo/redo... */
insert = g_signal_connect (GTK_OBJECT (buffer), "insert_text",
                        GTK_SIGNAL_FUNC (text_insert_cb), NULL);

and the callback
void text_insert_cb(GtkTextBuffer *buffer,
                                            GtkTextIter pos,
                                            const gchar *text,
                                            gint length,
                                            gpointer user_data)
{
fprintf(stderr,"%s", text);
}

but it prints some garbage
and when i run the program i get:
GLib-GObject-WARNING **: invalid cast from `GtkTextBuffer' to `GtkObject'

what's the problem here ?
can anyone point me ??

Thanks a million
-- 
----------------
-- Uniball @ DALnet
Linux registered user # 224950
ICQ # 58475622
With Great Power, Comes Great Responsibilities.


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