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

Re: Re: gdk_draw_gray_image_crashes



Hi,
	Actually, I did call gdk_rgb_init(). Just forgot to paste
it in. I call the following two funtions before the gtk_window_new()
call in the code given below:

gtk_init(&argc, &argv);
gdk_rgb_init();


Any other suggestions ?


Thanks,
Nikhil

 
> You have to call gdk_rgb_init();
> 
>         MfG
>         bmg
> 
> -- 
> "Des is vllig wurscht, was heut beschlos- | M G Berberich
>  sen wird: I bin sowieso dagegn!"          | berberic@fmi.uni-passau.de
> (SPD-Stadtrat Kurt Schindler; Regensburg)  |
> 
>
> Am Saturday, den 27. October 2001 09:52:17 schrieb Nikhil Hegde:
> > Hello,
> > 
> >         I am trying to display a simple gray image using 
> > gdk_draw_gray_image. It crashes on certain machines. The code and error
> > are given below. 
> > 
> > -------------------------------------
> > /* rgbbuf contains the gray information (8 bit depth), 
> > and is of size Width*Height */
> > 
> > main()
> > {
> >   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
> >   darea = gtk_drawing_area_new();
> >   gtk_drawing_area_size (GTK_DRAWING_AREA (darea), Width, Height);
> >   gtk_container_add (GTK_CONTAINER (window), darea);
> >   gtk_signal_connect (GTK_OBJECT (darea), "expose-event",
> >                         GTK_SIGNAL_FUNC (on_darea_expose), NULL);
> >   gtk_widget_show_all (window);
> > 
> >   gtk_main();
> > }
> > 
> > gboolean on_darea_expose (GtkWidget *widget,
> >                    GdkEventExpose *event,
> >                    gpointer user_data)
> > {
> >  gdk_draw_gray_image (widget->window, widget->style->white_gc, 
> >    0, 0, Width, Height, GDK_RGB_DITHER_NONE, rgbbuf, Width);
> > }
> > 




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