Re: Question..




> #1. What is a visual? I'm having trouble finding any documentation on
> the details of such things.

Pretty much any book on Xlib programming talks about Visuals.

I am not going to attemp to describe a visual, as my knowledge on them
has been empirically learned and I will sound like a dork explaining
it to you :-)

Now, supposing you know what a visual is:

> #2. What exactly does the following code do?
> 
>   gnomefe_depth = gdk_visual_get_best_depth();
>   gnomefe_visual = gdk_visual_get_best_with_depth(gnomefe_depth);
> 
>   gtk_widget_set_default_visual(gnomefe_visual);
> 
> #3. Why is this code better/different/worse than the above?
> 
>   gtk_widget_push_visual(gdk_imlib_get_visual());
>   gtk_widget_push_colormap(gdk_imlib_get_colormap());

The code below will force the visual to be the same as the one used by
Imlib (which usually chooses the best visual, but you can "downgrade"
the visual to something worse by using a configuration file).

This allows your widget to be able to hold images rendered by the
Imlib library (as Imlib renders all of its images on the
gdk_imlib_get_visual visual).

Miguel.



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