[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Casting GtkWidgets
The value of user_data is assigned to text_entry, which you then cast to a
GTK_ENTRY. This shows an error saing entyr != NULL failed. So text_entry
was NULL , and so user_data was NULL. Review the gtk_signal_connect call
where to conenct to signal, the last paramter is this call is the user_data
passed to the function. This will probably null. Assign a value to this
callback and you're problem will be solved. The other errors are a result
of this error.
Jeroen
On Mon, 02 Oct 2000 15:42:16 Naheed Vora wrote:
>
> void
> on_combo_entry1_activate (GtkEditable *editable,
> gpointer user_data)
> {
>
> GtkWidget *text_entry = user_data;
> char *string = gtk_entry_get_text(GTK_ENTRY (text_entry));
> g_print(string);
>
> }
>
> Error encountered :-
> ----------------------------------------------------------
>
> Gtk-WARNING **: invalid cast from (NULL) pointer to `GtkEntry'
>
> Gtk-CRITICAL **: file gtkentry.c: line 496 (gtk_entry_get_text):
> assertion `entry != NULL' failed.
>
> GLib-CRITICAL **: file gmessages.c: line 645 (g_print): assertion
> `format != NULL' failed.
>
> ----------------------------------------------------------
> Please guide me how can I cast the gpointer into char* which is recieved
> from signal caused by Gtk_entry widget.
>
> TIA
> nv
>
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@xxxxxxxxx
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>