[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Why does this small program cause an X11 BadMatch?
- From: Rich Burridge <Rich Burridge Sun COM>
- To: gtk-app-devel-list gnome org
- Subject: Why does this small program cause an X11 BadMatch?
- Date: Sat, 02 Mar 2002 09:28:29 -0800 (PST)
Hi all,
I've isolated the problem I'm seeing in converting an XView app to Gtk,
into the small example attached below.
Can somebody clue my in why this is giving me:
Gdk-ERROR **: BadMatch (invalid parameter attributes)
serial 36 error_code 8 request_code 62 minor_code 0
It's the:
gdk_window_copy_area(xid, svgc, 0, 0, xid, 0, 0, width, height);
that's bitching.
Note that I need this GdkPixmap to be a depth of 1 as I want to use it
later as a stencil in a GdkGC. It also needs to be created dynamically as
it might be a different width/height.
Thanks.
#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
GdkColor backgnd;
GdkColor foregnd;
GdkColormap *cmap;
GdkGC *svgc;
GdkGCValues gc_val;
GdkGCValuesMask gc_mask;
GdkPixmap *xid;
int
main(int argc, char **argv)
{
int width = 48;
int height = 28;
gtk_set_locale();
gtk_init(&argc, &argv);
cmap = gdk_colormap_get_system();
(void) gdk_color_black(cmap, &foregnd);
(void) gdk_color_white(cmap, &backgnd);
xid = gdk_pixmap_new(GDK_ROOT_PARENT(), width, height, 1);
gc_mask = GDK_GC_FOREGROUND | GDK_GC_BACKGROUND;
gc_val.foreground = foregnd;
gc_val.background = backgnd;
svgc = gdk_gc_new_with_values(GDK_ROOT_PARENT(), &gc_val, gc_mask);
gdk_gc_set_function(svgc, GDK_CLEAR);
gdk_window_copy_area(xid, svgc, 0, 0, xid, 0, 0, width, height);
gdk_gc_set_function(svgc, GDK_COPY);
gtk_main();
return(0);
}
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]