Re: Getting the Current Theme's Colors
- From: Thomas Wood <thos gnome org>
- To: Matthew Allen <fret memecode com>
- Cc: desktop-devel-list gnome org
- Subject: Re: Getting the Current Theme's Colors
- Date: Fri, 21 Sep 2007 10:26:02 +0100
On Fri, Sep 21, 2007 at 11:09:18AM +1000, Matthew Allen wrote:
> Hi,
>
> I'm integrating Lgi, a xlib based application framework, with the Gnome
> desktop. And I want to be able to make an Lgi application sensitive to
> the current theme's fonts and colors so that is blends in with the Gnome
> desktop.
>
> I've worked out how to query for the right system font to use. But I'm
> having a lot of trouble getting information about how to retrieve the
> theme's color scheme. I think I need to use gtk_style_lookup_color or
> maybe the color-hash property of the GtkStyle object. But I can't find
> any example code and the documentation is too brief. For instance
> gtk_style_lookup_color has a string parameter "color_name", but
> absolutely no description of what possible values you might be able to
> pass into it. The sorts of colors I need are the selection bg/fg color,
> text fg/bg, application workspace etc.
If you have access to the GtkStyle object, you might as well use the
GdkColor arrays in the struct directly. For example,
style->base[GTK_STATE_SELECTED] will give you the background colour for
selected text in an entry widget.
Symbolic colour schemes are a relatively new addition to GTK+, so I
would avoid using them directly. It is much safer to use the bg/fg and
base/text arrays to get colour information from the theme.
Regards,
Thomas
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]