Re: What's wrong?
- From: Mikael Hallendal <micke codefactory se>
- To: Roberto <robyegiuly libero it>
- Cc: GNOME Mailing List <gnome-devel-list gnome org>
- Subject: Re: What's wrong?
- Date: 02 May 2001 12:53:22 +0200
Hi!
You should use gnome_init instead of gtk_init when writing a GNOME
application.
Change this line:
gtk_init (&argc, &argv);
to something like this:
gnome_init ("AnimationProg", "0.1", argc, argv);
'AppName' 'Ver'
Regards,
Mikael Hallendal
Den 01 May 2001 22:20:15 +0200 skrev Roberto:
>
> What's wrong in this program?
> When it stars, it returns this error:
>
> Gdk-CRITICAL **: file gdkwindow.c: line 1406 (gdk_window_get_visual):
> assertion `window != NULL' failed.
>
> Gtk-CRITICAL **: file gtkwidget.c: line 4258 (gtk_widget_push_visual):
> assertion `visual != NULL' failed.
>
> Gtk-CRITICAL **: file gtkwidget.c: line 4242 (gtk_widget_push_colormap):
> assertion `cmap != NULL' failed.
>
> GnomeUI-CRITICAL **: file gnome-animator.c: line 843
> (gnome_animator_append_frames_from_imlib_at_size): assertion `rest == 0'
> failed.
>
>
> -----------------------------------------------------------------------------------
>
>
> #include <gnome.h>
> #include <gtk/gtk.h>
> #include <gdk/gdk.h>
> #include <stdio.h>
>
>
>
>
> int
> main (int argc, char **argv)
> {
> GtkWidget *window1;
> GtkWidget *animator;
> char *img = "malehead.png";
>
>
> gtk_init (&argc, &argv);
>
> window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_widget_set_name (window1, "window1");
> gtk_object_set_data (GTK_OBJECT (window1), "window1", window1);
> gtk_window_set_title (GTK_WINDOW (window1), "window1");
>
>
> animator = gnome_animator_new_with_size (32, 32);
>
>
> gnome_animator_append_frames_from_file_at_size (GNOME_ANIMATOR
> (animator),
> img,
> 0, 0,
> 25,
> 32,
> 32, 32);
>
> gnome_animator_set_loop_type (GNOME_ANIMATOR (animator),
> GNOME_ANIMATOR_LOOP_RESTART);
>
> gtk_container_add (GTK_CONTAINER (window1), animator);
>
>
> gnome_animator_start(GNOME_ANIMATOR (animator));
>
>
>
> gtk_widget_show(animator);
> gtk_widget_show_all(window1);
>
>
>
> gtk_main ();
>
> return 0;
> }
>
>
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list
--
+------------------------------------------
| email : micke hallendal net
| sms : micke mobil hallendal net
| homepage : http://micke.hallendal.net/
| PGP-key : micke.hallendal.net/mikhal.gpg
+------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]