Re: Problems with "changed" signal on GtkTextBuffer(Win32)
- From: "David Necas (Yeti)" <yeti physics muni cz>
- To: Miroslav Rajcic <rajcic sokrates hr>
- Cc: gtk-list gnome org
- Subject: Re: Problems with "changed" signal on GtkTextBuffer(Win32)
- Date: Tue, 24 Aug 2004 09:52:35 +0200
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]