Theme/Style support in an unknown environment...



Hi all,

  I'm developing an application that will be installed in an environment that
does not allow the gtk/theme config files to be installed in the standard
locations (nor would it be useful to do so).

  What I am trying to figure out is how to set up my application's look & feel
w/o relying on any external config files (i.e. compile the rcfile information
into the binary). Specifically, what I need to accomplish is the setting of
colors on certain widgets. As of now, what I am doing is the following:

int main(int, char **)
{
...
        gtk_rc_parse_string(
          "style \"MW\"\n"
          "{\n"
          " bg[NORMAL] = {1.0, 1.0, 1.0}\n"
          "}\n"
          "style \"MB\"\n"
          "{\n"
          " bg[NORMAL] = {0.5765, 0.5765, 1.0}\n"
          " bg[PRELIGHT] = {0.65, 0.65, 1.0}\n"
          " bg[ACTIVE] = {0.4000, 0.4000, 0.9}\n"
          "}\n"
          "style \"clear\"\n"
          "{\n"
          " bg_pixmap[NORMAL] = \"<parent>\"\n"
          "}\n"
          "widget \"main window\" style \"MW\"\n"
          "widget \"main window*GtkButton*\" style \"MB\"\n"
          "widget_class \"*EventBox*\" style \"clear\"");
...
}

Is there a more elegant way of doing this?

Also, I'd like to change the background color of the tooltips that I have to
something other than the default drab grey.

Any information would be appreciated, since the api reference is severely
lacking in information on styles & themes.

-JS

---------------------------
John Schmerge
schmerge cyber com




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