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

RE: Casting GTKWidgets - Urgent



It's basically telling you that the argument it receives is a NULL pointer
and not a GtkEntry.  If user_data is just data and not a widget, then you
are not setting the right function argument to text_entry and therefore
GTK_ENTRY().  If so, I believe the following should fix your problem;

GtkWidget *text_entry = editable;



				-- Stupid Genius
  
> ----------
> From: 	Naheed Vora[SMTP:nv@linuxstart.com]
> Sent: 	Monday, October 02, 2000 9:48 AM
> To: 	gtk-app-devel-list@gnome.org
> Subject: 	Casting GTKWidgets - Urgent
> 
> 
> 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@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 




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