Re: Problems with "changed" signal on GtkTextBuffer(Win32)



On Tue, Aug 24, 2004 at 09:41:23AM +0200, Miroslav Rajcic wrote:
> 
>  GtkTextBuffer *buffer = gtk_text_buffer_new (NULL);
> GtkWidget *textview1 = gtk_text_view_new_with_buffer (buffer);
>  gtk_signal_connect (GTK_OBJECT (buffer), "changed",
> G_CALLBACK(on_textview_edited),  NULL);
> 
> ...
> 
> On execution console is opened with warnings below, and callback is never
> called back on buffer changes:
> 
> GLib-GObject-WARNING **: invalid cast from 'GtkTextBuffer' to 'GtkObject'
> Gtk-CRITICAL **: file gtksignal.c: line 144 (gtk_signal_connect_full):
> assertion 'GTK_IS_OBJECT (object)' failed
> 
> Anyone has a clue what might be wrong here ?

You are using *long* deprecated gtk_signal_connect(),
use g_signal_connect() instead (have you read the doc?)

GtkTextBuffer is not a GtkObject, it's a only GObject
(have you read the doc?)

Then, it will be unnecessary to cast g_signal_connect()
argument to anything as it takes a gpointer.

Yeti


--
Do not use tab characters. Their effect is not predictable.



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