[Xr] Help !!! GTK and Xr

Soorya Kuloor skuloor at verano.com
Mon Apr 28 16:36:05 PDT 2003


Hi Owen,

Thanks a lot for your help. Now I can use both ways of drawing.

On Mon, 2003-04-28 at 16:08, Owen Taylor wrote:
> On Mon, 2003-04-28 at 15:12, Soorya Kuloor wrote:
> > Hi,
<snip ... snip>
> > 
> > 1. GDK_DRAWABLE_XID(widget->window)
> 
> If you are called in an expose() handler, you probably need to
> use 
> 
> 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.	
> 

Yes, this worked.

> > 2. I do not understand what to do with the GC object
> 
> Why do you think you need a GC?

The SWT toolkit's examples use drawing on the GC object for 2D stuff
when using their drawing routines. This is where I got confused. I now
do not use the GC when drawing directly to the window using the above
method that you suggest. When using double buffering, I draw stuff on
the GdkPixmap and then do a SWT's GC.drawImge() to draw the image onto
the GC.

Does Gtk use double buffering for painting? I may still need to draw on
a separate Image object and then draImage() it on the GC object, to
support Windows platform (I am using GDI+ on windows). If I did this on
Gtk (i.e. my own double buffering) will I pay any performance penalties?

Thanks,
-- Soorya

> 
> Regards,
>                                                   Owen
> 
> 
> 
> _______________________________________________
> Xr mailing list
> Xr at xwin.org
> http://xwin.org/cgi-bin/mailman/listinfo/xr





More information about the cairo mailing list