Re: GtkImage problem
On Sat, May 05, 2007 at 04:27:14PM -0700, beginner.c wrote: As suggested I've done: gtk_image_set_from_file (GTK_IMAGE(image), /home/s/Pictures/space-05.jpg); Please see my answer http://mail.gnome.org/archives/gtk-list/2007-May/msg00039.html unfortunately sent to the wrong mailing list thanks to the bloody unset Reply-To headers. Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkImage problem
Thanks for the response but as you can see from my original post I am in fact calling gtk_init() prior to any of these functions. David Nečas (Yeti)-2 wrote: On Sat, May 05, 2007 at 04:27:14PM -0700, beginner.c wrote: As suggested I've done: gtk_image_set_from_file (GTK_IMAGE(image), /home/s/Pictures/space-05.jpg); Please see my answer http://mail.gnome.org/archives/gtk-list/2007-May/msg00039.html unfortunately sent to the wrong mailing list thanks to the bloody unset Reply-To headers. Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- View this message in context: http://www.nabble.com/GtkImage-problem-tf3694858.html#a10344471 Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkImage problem
On Sun, May 06, 2007 at 04:06:11AM -0700, beginner.c wrote: I am in fact calling gtk_init() prior to any of these functions. No, you don't, the call to gtk_image_new() to initialize image GtkWidget *image = gtk_image_new(); is performed before any code in main(). Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkImage problem
You are right. Thanks for that. Everything executes without error...except, no image is displayed. void create_window (GtkWidget *window, GtkWidget *image) { GladeXML *gxml; gxml = glade_xml_new (GLADE_FILE, NULL, NULL); /* This is important */ glade_xml_signal_autoconnect (gxml); window = glade_xml_get_widget (gxml, window); image = glade_xml_get_widget (gxml, image1); } void funcImage (GtkWidget *image) { image = gtk_image_new(); gtk_image_clear(GTK_IMAGE(image)); gtk_image_set_from_file (GTK_IMAGE(image), /home/s/Pictures/space-05.jpg); gtk_widget_show(image); } int main (int argc, char *argv[]) { GtkWidget *window = NULL; GtkWidget *image = NULL; #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, UTF-8); textdomain (GETTEXT_PACKAGE); #endif gtk_set_locale (); gtk_init (argc, argv); create_window (window,image); funcImage(image); //gtk_widget_show_all (window); gtk_main (); return 0; } David Nečas (Yeti)-2 wrote: On Sun, May 06, 2007 at 04:06:11AM -0700, beginner.c wrote: I am in fact calling gtk_init() prior to any of these functions. No, you don't, the call to gtk_image_new() to initialize image GtkWidget *image = gtk_image_new(); is performed before any code in main(). Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- View this message in context: http://www.nabble.com/GtkImage-problem-tf3694858.html#a10350080 Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkImage problem
I'm thinking you'll want to add: gtk_widget_show_all(window); With that you can remove: gtk_widget_show(image); - Original Message From: beginner.c [EMAIL PROTECTED] To: gtk-app-devel-list@gnome.org Sent: Sunday, May 6, 2007 6:36:32 PM Subject: Re: GtkImage problem You are right. Thanks for that. Everything executes without error...except, no image is displayed. void create_window (GtkWidget *window, GtkWidget *image) { GladeXML *gxml; gxml = glade_xml_new (GLADE_FILE, NULL, NULL); /* This is important */ glade_xml_signal_autoconnect (gxml); window = glade_xml_get_widget (gxml, window); image = glade_xml_get_widget (gxml, image1); } void funcImage (GtkWidget *image) { image = gtk_image_new(); gtk_image_clear(GTK_IMAGE(image)); gtk_image_set_from_file (GTK_IMAGE(image), /home/s/Pictures/space-05.jpg); gtk_widget_show(image); } int main (int argc, char *argv[]) { GtkWidget *window = NULL; GtkWidget *image = NULL; #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, UTF-8); textdomain (GETTEXT_PACKAGE); #endif gtk_set_locale (); gtk_init (argc, argv); create_window (window,image); funcImage(image); //gtk_widget_show_all (window); gtk_main (); return 0; } David Nečas (Yeti)-2 wrote: On Sun, May 06, 2007 at 04:06:11AM -0700, beginner.c wrote: I am in fact calling gtk_init() prior to any of these functions. No, you don't, the call to gtk_image_new() to initialize image GtkWidget *image = gtk_image_new(); is performed before any code in main(). Yeti -- http://gwyddion.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list -- View this message in context: http://www.nabble.com/GtkImage-problem-tf3694858.html#a10350080 Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GtkImage problem
As suggested I've done: gtk_image_set_from_file (GTK_IMAGE(image), /home/s/Pictures/space-05.jpg); However, the image is no longer displayed and I get these errors (process:7344): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:7344): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:7344): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:7344): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:7344): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (process:7344): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:7344): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:7344): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed (testreference:7344): Gtk-CRITICAL **: gtk_widget_show: assertion `GTK_IS_WIDGET (widget)' failed (testreference:7344): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion `instance != NULL instance-g_class != NULL' failed (testreference:7344): Gtk-CRITICAL **: gtk_image_set_from_file: assertion `GTK_IS_IMAGE (image)' failed beginner.c wrote: I have the following code, which comiles and displays the image yet I get the following errors Compile error passing argument 1 of 'gtk_image_set_from_file' from incompatible pointer type Runtime errors (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed (testreference:12275): Gtk-CRITICAL **: gtk_widget_show: assertion `GTK_IS_WIDGET (widget)' failed #include sys/types.h #include sys/stat.h #include unistd.h #include string.h #include stdio.h #include config.h #include gtk/gtk.h #include glade/glade.h /* * Standard gettext macros. */ #ifdef ENABLE_NLS # include libintl.h # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop #define N_(String) gettext_noop (String) # else #define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #include callbacks.h /* For testing propose use the local (not installed) glade file */ /* #define GLADE_FILE PACKAGE_DATA_DIR/testreference/glade/testreference.glade */ #define GLADE_FILE testreference.glade void create_window (GtkWidget *window, GtkWidget *image) { GladeXML *gxml; gxml = glade_xml_new (GLADE_FILE, NULL, NULL); glade_xml_signal_autoconnect (gxml); window = glade_xml_get_widget (gxml, window); image = glade_xml_get_widget (gxml, image1); } void funcImage (GtkWidget *image) { gtk_image_set_from_file (image, /home/s/Pictures/space-05.jpg); } int main (int argc, char *argv[]) { GtkWidget *window = NULL; GtkWidget *image = gtk_image_new(); #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, UTF-8); textdomain (GETTEXT_PACKAGE); #endif gtk_set_locale (); gtk_init (argc, argv); create_window (window,image); gtk_widget_show (window); funcImage(image); gtk_main (); return 0; } -- View this message in context: http://www.nabble.com/GtkImage-problem-tf3694858
GtkImage problem
I have the following code, which comiles and displays the image yet I get the following errors Compile error passing argument 1 of 'gtk_image_set_from_file' from incompatible pointer type Runtime errors (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: gtype.c:2242: initialization assertion failed, use IA__g_type_init() prior to this function (process:12275): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed (testreference:12275): Gtk-CRITICAL **: gtk_widget_show: assertion `GTK_IS_WIDGET (widget)' failed #include sys/types.h #include sys/stat.h #include unistd.h #include string.h #include stdio.h #include config.h #include gtk/gtk.h #include glade/glade.h /* * Standard gettext macros. */ #ifdef ENABLE_NLS # include libintl.h # undef _ # define _(String) dgettext (PACKAGE, String) # ifdef gettext_noop #define N_(String) gettext_noop (String) # else #define N_(String) (String) # endif #else # define textdomain(String) (String) # define gettext(String) (String) # define dgettext(Domain,Message) (Message) # define dcgettext(Domain,Message,Type) (Message) # define bindtextdomain(Domain,Directory) (Domain) # define _(String) (String) # define N_(String) (String) #endif #include callbacks.h /* For testing propose use the local (not installed) glade file */ /* #define GLADE_FILE PACKAGE_DATA_DIR/testreference/glade/testreference.glade */ #define GLADE_FILE testreference.glade void create_window (GtkWidget *window, GtkWidget *image) { GladeXML *gxml; gxml = glade_xml_new (GLADE_FILE, NULL, NULL); glade_xml_signal_autoconnect (gxml); window = glade_xml_get_widget (gxml, window); image = glade_xml_get_widget (gxml, image1); } void funcImage (GtkWidget *image) { gtk_image_set_from_file (image, /home/s/Pictures/space-05.jpg); } int main (int argc, char *argv[]) { GtkWidget *window = NULL; GtkWidget *image = gtk_image_new(); #ifdef ENABLE_NLS bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, UTF-8); textdomain (GETTEXT_PACKAGE); #endif gtk_set_locale (); gtk_init (argc, argv); create_window (window,image); gtk_widget_show (window); funcImage(image); gtk_main (); return 0; } -- View this message in context: http://www.nabble.com/GtkImage-problem-tf3694858.html#a10332372 Sent from the Gtk+ - Apps Dev mailing list archive at Nabble.com. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list