Re: GdkRGB behaviour




Derek Simkowiak <dereks@kd-dev.com> writes:

> 	In Havoc's book, "GTK+/Gnome Application Development", page 237,
> paragraph 1 says (with regard to GtkRGBs):
> 
> " The drawable you intend to copy the RGB buffer to must use GdkRGB's
> visual and colormap.  If the drawable is part of a widget, the easiest way
> to ensure this is to push the GdkRGB visual and colormap when you create
> the widget:
> [...snip example code...] 
> The current version of GTK+ will behave better if you do this when
> creating the toplevel window containing the drawable, instead of when you
> create the drawable itself.  However, in principle you can do it for only
> the drawable. "

Hmmm, well Havoc is about 70% right. Yes, you should do
it to the toplevel window. But the reason is somewhat differnet
from what is indicated here. The problem is not in GTK+'s
handling of multiple colormaps within a single window, it
is that most X servers cannot handle multiple simultaneously
installed colormaps, so the window will be misdisplayed
on a pseudo-color display.

And while this situation will be addressed, it won't be
addressed by making it possible to set multiple colormaps
within the same window, it will be fixed by changing
GdkRGB to be able to draw within any visual and colormap
and making the visual/colormap from gdk_rgb_get_* 
only the preferred colormap/visual. The code to do this
is basically all there in GdkRGB ... it's just a matter
of some reorganization.
 
> 	I'm considering using a GdkRGB to try to speed up the rendering of
> the GtkText widget. 

As Havoc said, I _really_ cannot imagine how GdkRGB could
possibly help. And how fast do you want to it to render anyways?
The hard part in making a text widget perform is the layout
calculations, rendering is insignificant.

>  Since the widget itself will never be the "toplevel"
> window, I'm wondering if this would be a bad idea.  Has this been fixed?

Yes, it would be a bad idea. No, it has not been fixed yet.

Regards,
                                        Owen



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