Re: [gtk-list] Re: Drawing lines



>:Drawing the lines using Xor mode?
>  ok, how?

You need to set the drawing function of a GC to GDK_XOR and use that
GC to paint.  You can use gdk_gc_set_function() for that.  Try
something like

	GdkGC *gc;
	GdkColor color;

	gc = gdk_gc_new (my_window);
	gdk_color_white (gdk_window_get_colormap (my_window), &color);
	gdk_gc_set_foreground (gc, &color);
	gdk_gc_set_function (gc, GDK_XOR);

	gdk_draw_line (wheeeee);
	gdk_gc_destroy (gc);

Of course you don't want to create and destroy a GC every time you paint
something, because that will be pretty expensive.  You should create a
GC at startup and keep it around until you destroy the window.

Suggestion: get hold of some Xlib reference manual and read it.  It
will make your life easier :-)

  Quartic



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