Re: Efficient use of GDK Graphic contexts



GCs are tied to windows,

Er, no, they aren't. (Neither X11 GCs nor GdkGCs.) Even if XCreateGC()
takes a Drawable and gdk_gc_new() takes a GdkDrawable as parameter,
that doesn't mean the created GC is tied to that drawable (window or
pixmap).

The manpage for XCreateGC() says "The GC can be used with any
destination drawable having the same root and depth as the specified
drawable." The documentation for gdk_gc_new() says "The created GC
must always be used with drawables of the same depth as this one."

(A Win32 DC, which has a similar function as an X11 GC, *is* specific
to the window or bitmap ("pixmap") specified at its creation,
though. GDK hides this detail, you can use the same GdkGC with any
GdkDrawable also on Win32. GDK creates and destroys Win32 DCs on the
fly.)

--tml




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