gdk_draw_gray_image crashes



#include <gtk/gtk.h>
#include <gdk/gdk.h>
Hi,
Based on an example I grabed from this list, I tried to compile a short program for drawing a gray image to a 
window (see below). But on my system the gdk_draw_gray_image routine crashes:
Gdk-ERROR **: BadMatch (invalid parameter attributes)
  serial 107 error_code 8 request_code 130 minor_code 3
What am I doing wrong?
My system:
SunOS 5.6 Generic_105181-14 sun4u sparc SUNW,Ultra-5_10
egcs-2.91.66
libgdk-1.2.so.0.5.2
libgtk-1.2.so.0.5.2

Thanx for any suggestions,
Jan

#include <gtk/gtk.h>
#include <gdk/gdk.h>

int main(int argc, char **argv)
{
  guchar buf[]={255};  
  gint x, y, w, h, rowstride; 
  GdkRgbDither dith; 
  GtkWidget *window;

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

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_widget_show(window);

  x = 0; 
  y = 0; 
  w = 1; 
  h = 1; 
  rowstride = 1; 
  dith = GDK_RGB_DITHER_NONE;
 
  gdk_draw_gray_image(window->window, window->style->black_gc,
                      x,y,w,h,dith,buf,rowstride);
  
  gtk_main();

  return 0;
}

-- 
-----------------------------------------------------------------
    _/_/_/ _/  _/        Jan Boehm  Dipl.-Inform. M.Sc.
   _/_/_/    _/   _/_/   Institut fuer Photogrammetrie
  _/_/_/ _/ _/_/ _/ _/   Universitaet Stuttgart
 _/_/_/ _/ _/   _/_/     Geschwister-Scholl-Str. 24
          _/   _/        D-70174 Stuttgart
-----------------------------------------------------------------
Tel : +49-711-121-4110   Email : jan boehm ifp uni-stuttgart de 
Fax : +49-711-121-3297   WWW   : www.ifp.uni-stuttgart.de
-----------------------------------------------------------------

Attachment: jan.boehm.vcf
Description: Card for Jan Böhm



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