theme-switch hack



Hi again, 
I was looking at theme-switch from muhri. He allows to preview themes
before he switch them. And he does this with:

1) locate theme
2) fork another process
        inside the child he does

        gchar *default_files[2] = { located_theme , NULL };
        gtk_rc_set_default_files( default_files );
        gtk_init( &argc, &argv );

        create preview_window with plenty widgets

This is because he needs really fresh gtk. Tweaking default_files 
after gtk_init is too late. When I first do gtk_init and then change 
gtk_rc_set_default_files, or call reparse_all or anything, I will always 
get some strange merge of several themes.
        As I don't understand gtkrc exactly, I think that the problem
might be in static variable global_rc_files in gtkrc.c. Every new theme 
is added there, but never removed. Is my intention correct ? 

I'd like to write theme-switch in similar way as gnomecc. No need to
fork. Have some widgets in container and say them to change theme.
But I don't understand gnomecc code. I was completely lost, when even
browsing through it. 
Can someone gimme a hint please ?
                                
Suk      

-- 
signed short            (mail)



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