Re: gtk_color_selector bugs



Owen Taylor wrote:
> 
[... stuff about the color selection dialog ... ]

> 
> This would require adding:
> 
>  gtk_widget_set_colormap/visual()
> 
> But since changing the colormap and visual of a widget on
> the fly is not supported in GTK+, (some of the code
> in GTK+ is written with an idea to supporting this
> for unrealized widgets, but not all), there would
> also have to be big disclaimers
> 
>  "Use these functions only before a widget is first
>   realized and only if you know what you are
>   doing"
> 
> Anything else I am missing here?
> 
>                                         Owen
> 

This is similar to what I needed to put a jpg loaded by gdk_imlib
into a GtkPixmap. I wound up calling 

gtk_object_set_data("gtk-colormap", gdk_imlib_get_colormap());
gtk_object_set_data("gtk-visual", gdk_imlib_get_visual());

between gtk_window_new() and gtk_widget_realize(). Doing
this seemed like a hack. Especially since those strings are
defined in the .c files instead of the header.

(Owen: this is similar to the example from the imlib manual you
 helped me get working )

Is there an easier way to do this or should there be a way to 
set the visual/colormap for a GtkWindow in an easier fashion?

Did this not come up before because most X-servers on Linux have
only one visual depth? One nice thing about Solaris's X-server is 
support of multiple color depths. I just wish it wasn't so easy to
crash. (No crashes from gtk in many months, but I've had my share)

Todd.
-- 
-----------------------------------------
Todd & Lisa Dukes
tjdukes@flash.net



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