Could this method be used to embed a font into a Gtk# application?

Thanks,

Liam
On 04/10/2013 07:34, Wolfgang Silbermayr wrote:
On 2013-10-03 22:42, Weston Weems wrote:
Wow that worked almost perfectly... I had to track down windows version
of some of the theme engines, the themes I was trying to use,
utilized.... but aside from that it was good.

Is there any rhyme or reason on how to help the theme engine locate
resources like images and such? Some of these themes will do like a
./assets/toolbarbg.png or whatever...
Good to see that it helped.

I have not investigated this further, but I think you have to start from
the Icon* classes, like IconFactory, IconSource or IconTheme. I have,
however, not yet figured out the link that leads from Gtk.Rc towards the
Icon* classes.

On Wed, Oct 2, 2013 at 12:05 AM, Wolfgang Silbermayr
<[email protected] <mailto:[email protected]>> wrote:

     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.


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





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

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

Reply via email to