Re: can anybody help with bebugging a little displaying program?



On Tue, Mar 19, 2002 at 12:06:53AM +0000, guo li wrote:
> 
> the run time  error is:
> 
> i olympia GTK]$ ./a.out
> 
> ** CRITICAL **: file gdk-pixbuf-render.c: line 205 
> (gdk_pixbuf_render_to_drawable): assertion `drawable != NULL' failed.
> [gli olympia GTK]$
> 
> 
> 
>                     pixbuf = gdk_pixbuf_new_from_file("rose");
>                     gtk_widget_set_usize(widget, 
> gdk_pixbuf_get_width(pixbuf),gdk_pixbuf_get_height(pixbuf));
the GdkWindow in the widget is invalid before it is realized(which will
be realized when  you call gtk_widget_show ,or gtk_widget_realize,
call  gtk_widget_realize(widget); before you are trying to use the
window member in GtkWidget


>                     gdk_pixbuf_render_to_drawable (pixbuf, 
> widget->window,widget->style->white_gc, 0, 0,0,0,
>                                                    
> gdk_pixbuf_get_width(pixbuf),
>                                                    
> gdk_pixbuf_get_height(pixbuf),
>                                                    GDK_RGB_DITHER_NORMAL, 
> 0, 0);
> 
> 
>                     gtk_container_add(GTK_CONTAINER(window), widget);
> 
>                     gtk_widget_show(widget);
>                     gtk_widget_show  (window);
>                     gtk_main ();
>                     return 0;
>                 }
> 
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 

-- 
pub  1024D/FA54C566 2000-06-04 Wan Hing Wah (Chinese) <hingwah programmer net>
     Key fingerprint = 0E99 9956 B340 DA66 DB9C  85B7 1AC5 8939 FA54 C566
sub  1024g/4EE841C3 2000-06-04




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