Gtk rc file parsing question



Hi folks,

My application parses a special rc file, assigning special styles to
some of my widgets, using named styles, and gtk_widget_set_name.

This works beautifully.

I have two different rc files (at the moment), in separate
directories. One uses colours to change the widgets, the other is a
pixmap engine theme, assigning backgroung pixmaps to the widgets.

I have a properties box, allowing users to change between these rc
files.

Currently, when the theme is changed, I call gtk_rc_parse with the
newly selected rc file path, then I call
gtk_widget_reset_rc_styles(window) where window is a pointer to the
main window containing the widgets.

This does not do quite what I wanted. This adds the new style to the
existing ones (the rc files use the same named styles).

This means when changing from the plain gtkrc to the pixmap engine
gtkrc, the pixmaps are correctly applied to the widgets, but I suspect
the background colouration remains behind these. When switching from
the pixmap to the plain gtkrc, the widgets inherit background colours
behind the pixmaps, which remain, so the widgets do not appear to have
changed.

How do I get gtk to "forget" the previous gtkrc, (I can tell it the
path to that file), or to forget what those named styles are and
reload from scratch, before doing gtk_rc_parse on the new file?

This would solve a big problem for me. I _have_ scoured the docs, and
even delved into the source of the gnome theme-switcher capplet, as the
preview window changes themes through code. This capplet appears not to
forget previous settings though, and is cumulative. So if I load a
theme with no styles defined (or missing styles) those from the
previously selected theme are used.

Can anyone help me?

Tom.
-- 
            .-------------------------------------------------------.
    .^.     | Tom Gilbert, England | tom@tomgilbert.freeserve.co.uk |
    /V\     |----------------------| www.tomgilbert.freeserve.co.uk |
   // \\    | Sites I recommend:   `--------------------------------|
  /(   )\   | www.freshmeat.net www.enlightenment.org www.gnome.org |
   ^^-^^    `-------------------------------------------------------'



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