tecknophreak
04-25-2003, 03:48 PM
I've got two different themes I created for my GTK+ GUI, but I can't seem to figure out how to change the themes when I'm up and running.
Do I have to stop gtk_main and restart it or do I have to change the style of each widget I've got out there? Or is it easier than that?
bwkaz
04-25-2003, 04:44 PM
Maybe something on this page helps?
http://developer.gnome.org/doc/API/2.0/gtk/GtkStyle.html
I'd try gtk_style_attach, myself, but I don't know if it'll work or not.
tecknophreak
04-25-2003, 05:49 PM
Man, bwkaz, you're a posting feind in here.
Anyway, here's what i ended up doing,
// trying to change theme
if (!theme) {
system("rm -f fonts.rc");
system("cp dark.rc fonts.rc");
gtk_rc_reparse_all();
theme = true;
}
else {
system("rm -f fonts.rc");
system("cp blue.rc fonts.rc");
gtk_rc_reparse_all();
theme = false;
}
Basically, just replacing the theme, then reparsing the file. Works really fast, considering it's pretty small files I'm working with. Should probably be using exec though, right?