Re: Novice canvas questions



>  I'm learning GnomeCanvas and friends, and I have some little questions:
>  
>  1. When I create a new canvas, GGAD say one may could create it under a
>  non-default visual and colormap, in the following way (in GDK mode):
>  
>     GtkWidget* canvas;
>     gtk_widget_push_visual(gdk_imlib_get_visual());
>     gtk_widget_push_colormap(gdk_imlib_get_colormap());
>     canvas = gnome_canvas_new();
>     gtk_widget_pop_visual();
>     gtk_widget_pop_colormap();
>  
>    My question is: why should I need a non-default visual and a
>    colormap?

If you are using the Gdk canvas, and you want to use the
GnomeCanvasImage item, you'll need to push gdk_imlib's visual and
colormap (the Image item uses imlib).

If you are using the canvas in any mode and you want to use an item
such as GnomeCanvasPixbuf that uses GdkRGB, you'll have to push
GdkRGB's visual and colormap instead.

(I would recommend using GnomeCanvasPixbuf instead of GnomeCanvasImage
to avoid using imlib...)

>    (if anyone notice, this question is really: "what is a visual and a
>     colormap?". If anybody knows a easy introduction abouty visual and
>     colormaps, I will thank to point me to it.)

There's an explanation in the X-concepts document in the gnome-docu
module on CVS.  The section on visuals is complete, I think, but the
colormaps one is unwritten.  You may be able to grok something about
colormaps from the visuals section, though.

(This whole document will appear as a feature article on the
developer's site when I have a chance to finish it).

>  2. It seems to me that AA mode supports traslucent canvas items, but GDK
>  mode doesn't. Is that correct?

That is correct.

  Federico



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