Re: [gtk-list] Creating non-window GC



>    GdkBitmap *newmask., *xpmmask;
>    GdkGc *bmp_gc;
>  
>    newmask = gdk_image_new_bitmap( visual, zerodata, w, h );
>    bmp_gc  = gdk_gc_new((GdkWindow *)newmask);
>    gdk_draw_image(
>      (GdkWindow *)newmask, bmp_gc, xpmmask, 0,0, 0,0, w,h );
>  
>  
>    ... in order to copy a bitmap mask.
>  
>  a) is there another/better way of doing this? Because, 
>  
>  b) It dumps core due to gdk_gc_new insisting that it's arg. is a GdkWindow
>  (not any drawable), and this object's private type has xdisplay in a
>  different location to GdkBitmap's private, so one /can't/ cast from bmp to
>  win. If the above is done, an erroneous xdisplay is extracted and
>  XCreateGC() crashes.

This makes no sense at all.  gdk_image_new_bitmap() is

	GdkImage* gdk_image_new_bitmap(GdkVisual     *visual,
					gpointer      data,
					gint          width,
					gint          height);

i.e. it creates a GdkImage, not a GdkBitmap.  The gdk_gc_new()
function takes in a drawable (window or pixmap/bitmap) to figure out
in which screen to create the GC; it does *not* take in a GdkImage.

  Federico



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