[Gtk-sharp-list] Overiding the default gtk theme

Anset Anset at anset.org
Thu Jun 23 05:49:14 EDT 2005

Hi all,

I want my application to use my own theme.
Whatever global theme the user has selected for his or her system should 
not interfere with my theme.

For this, at the top of my rc file, I create a simple "default" style 
and then put the lines

class "*" style "mydefstyle"
widget "*" style "mydefstyle"

Then, in my application, at a certain point I call Rc.AddDefaultFile to 
add my own theme file, and then I call Rc.Parse on my file. (I think 
that I don't realy have to add the file to the default file list, but it 
never seemd to hurt do do it.)

When I was using gtk# 1.9.2, this worked as expected, but now that I 
have upgraded to 1.9.3, the system-wide default theme is applied after 
my own theme and my application looks bad.

I have been looking for a way to tell gtk not to look at the default 
files, but it would seem that that is not possible? Monodoc tells me 
that the Rc.DefaultFiles propperty works with a string, but if I try 
something like

Rc.DefaultFiles = "";

before my call to Gtk.Init, I get a nullexception.

One other thing that happens since I upgraded to 1.9.3 is that at the 
start of my application (at the time of the Init call) I get the 
following error:

(<unknown> 3828): Glib-CRITICAL ** g_convert: assertion 'str != NULL failed

I don't know where this comes form but It does not seem related...

Can anybody help me out?

Thank you for your time,


More information about the Gtk-sharp-list mailing list