On 2013-10-01 19:05, Weston Weems wrote:
> I'd like to embed a gtk+ theme, so I can effectively skin my app and
> look the same way regardless of what default gtk+ theme is setup.
> 
> Is this something I can do? I've read people make comments of using
> resource files etc... but I have yet to hear specific details on this...
> or better yet an example.
> 
> Anyone have any pointers?

You can deploy your own gtkrc file and load the data from there:

Gtk.Application.Init();
string filename = "/the/path/to/my.gtkrc";
Gtk.Rc.Parse(filename);

or my preferred method: you include the gtkrc file as a resource inside
your assembly:

Gtk.Application.Init();
using (Stream stream =
  GetType().Assembly.GetManifestResourceStream("my.gtkrc"))
{
  using (TextReader reader = new StreamReader(stream))
  {
    Gtk.Rc.ParseString (reader.ReadToEnd());
  }
}

Hope this helps.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to