gdk_draw_gray_image crashes



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. 

The machine details are:
SunOS benhur 5.6 Generic_105181-28 sun4u sparc SUNW,Ultra-5_10


-------------------------------------
/* rgbbuf contains the gray information, 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);
}

-------------------------------------
$ gcc -o image -R/usr/local/lib `gtk-config --cflags` image.c
`gtk-config --libs`
$ image

Gdk-ERROR **: BadMatch (invalid parameter attributes)
  serial 105 error_code 8 request_code 130 minor_code 3

aborting...
Abort
$
-------------------------------------

Other functions such as gdk_draw_rectangle work fine. I suspect this is
something to do with the gc, but am not sure.

Any ideas ?

Thanks,
Nikhil




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