Re: Efficient use of GDK Graphic contexts



Thanks Tor for the helpful response.  This seems a lot more sane to me.  More
comments follow:

The manpage for XCreateGC() says "The GC can be used with any
destination drawable having the same root and depth as the specified
drawable."

Just to clarify, "root" is root X window?  So I could theoretically have one GC that
I use between windows of the same application?  "Depth" must mean "Color Depth" and
not window recurrsion depth.  Guess my brain is wired weird, because that's what I
thought the first time I read it.

The documentation for gdk_gc_new() says "The created GC
must always be used with drawables of the same depth as this one."

*blush*.  Sorry, missed that.  Should teach me to read all the documentation,
including the param comments and not just the main description.


(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.)

I guess the way I'm currently doing my GCs is fine too since this is what probably
happens on Win32.  I'll still move over to one global GC just because it's cleaner.

Thanks!



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