[Xr] Help !!! GTK and Xr

Owen Taylor otaylor at redhat.com
Mon Apr 28 15:08:57 PDT 2003

On Mon, 2003-04-28 at 15:12, Soorya Kuloor wrote:
> Hi,
> I am new to 2D stuff and for that matter with Gtk. I am trying to
> develop an Xr based extension to Eclipse on Linux (Redhat 9). I am using
> the Gtk version of eclipse. I am trying to use drawing with and without
> double-buffering.
> In the SWT programs paint() method, I have the following objects at
> hand:
> * A GtkWidget object that represents the SWT Shell that I am drawing on
> * A GdkGC object that represents the GC that I need to draw on
> * For use in double buffering, I can also create a SWT Image object,
> which encapsulates a GdkPixmap object.
> I am using a JNI layer library to link the Java world to the C world.
> The JNI layer basically exports the Xr API into Java plus some
> convinience functions to set drawables.
> I have tried a whole bunch of arguments to XrSetTargetDrawable()
> function.
> The 'drawable' arg that I tried are
> 1. GDK_DRAWABLE_XID(widget->window)

If you are called in an expose() handler, you probably need to

void gdk_window_get_internal_paint_info (GdkWindow    *window,
                                         GdkDrawable **real_drawable,
                                         gint         *x_offset,
                                         gint         *y_offset);

Since during painting, GTK+ redirects drawing to an offscreen
pixmap. If you write directly to the window, then that will be
overwritten when GTK+ copies the backing pixmap onto the window.	

> 2. I do not understand what to do with the GC object

Why do you think you need a GC?


More information about the cairo mailing list