Re: GtkStyleKey / GtkStyle




Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE> writes:

> Hi,
> 
> what about moving the definition of _GtkStyleKey from gtkstyle.c to
> gtkstyle.h and define _GtkStyle as follows:

[...]

> Previously Gtkstyle was defined as follows
> struct _GtkStyle
> {
>   GdkColor fg[5];
>   GdkColor bg[5];
>   GdkColor light[5];
> ...
> 
> which is simply wrong as you could not access the depth value for example.

I'm not sure I'd agree about "wrong". A style won't even have a depth,
unless it is attached to a window.

So, if a widget is realized, you can get the depth of the widget's
style with:

  gdk_window_get_geometry (widget->window, NULL, NULL, NULL, NULL, &depth);

Otherwise, the style's depth is not defined.

Now, this is slighty inefficient, since it requires a call to the
server, but I don't think putting the depth into the style is the
right thing to do.

If you are really concerned about efficiency, it might be possible to
make a gdk_widow_get_depth call that cached the value, since it
doesn't change for a window. But that's only an optimization.

Maybe you could explain what you are trying to achieve?

Regards,
                                              Owen



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