mail-archives/gtk-sharp-list/2013-October/011326.html

129 строки
5.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Embed Gtk+ theme into app
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=Re%3A%20%5BGtk-sharp-list%5D%20Embed%20Gtk%2B%20theme%20into%20app&In-Reply-To=%3C524E6177.7090704%40silbermayr.at%3E">
<META NAME="robots" CONTENT="index,nofollow">
<style type="text/css">
pre {
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
}
</style>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="011325.html">
<LINK REL="Next" HREF="011327.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Embed Gtk+ theme into app</H1>
<B>Wolfgang Silbermayr</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=Re%3A%20%5BGtk-sharp-list%5D%20Embed%20Gtk%2B%20theme%20into%20app&In-Reply-To=%3C524E6177.7090704%40silbermayr.at%3E"
TITLE="[Gtk-sharp-list] Embed Gtk+ theme into app">wolfgang at silbermayr.at
</A><BR>
<I>Fri Oct 4 06:34:31 UTC 2013</I>
<P><UL>
<LI>Previous message: <A HREF="011325.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI>Next message: <A HREF="011327.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#11326">[ date ]</a>
<a href="thread.html#11326">[ thread ]</a>
<a href="subject.html#11326">[ subject ]</a>
<a href="author.html#11326">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>On 2013-10-03 22:42, Weston Weems wrote:
&gt;<i> Wow that worked almost perfectly... I had to track down windows version
</I>&gt;<i> of some of the theme engines, the themes I was trying to use,
</I>&gt;<i> utilized.... but aside from that it was good.
</I>&gt;<i>
</I>&gt;<i> Is there any rhyme or reason on how to help the theme engine locate
</I>&gt;<i> resources like images and such? Some of these themes will do like a
</I>&gt;<i> ./assets/toolbarbg.png or whatever...
</I>
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.
&gt;<i> On Wed, Oct 2, 2013 at 12:05 AM, Wolfgang Silbermayr
</I>&gt;<i> &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">wolfgang at silbermayr.at</A> &lt;mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">wolfgang at silbermayr.at</A>&gt;&gt; wrote:
</I>&gt;<i>
</I>&gt;<i> On 2013-10-01 19:05, Weston Weems wrote:
</I>&gt;<i> &gt; I'd like to embed a gtk+ theme, so I can effectively skin my app and
</I>&gt;<i> &gt; look the same way regardless of what default gtk+ theme is setup.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Is this something I can do? I've read people make comments of using
</I>&gt;<i> &gt; resource files etc... but I have yet to hear specific details on
</I>&gt;<i> this...
</I>&gt;<i> &gt; or better yet an example.
</I>&gt;<i> &gt;
</I>&gt;<i> &gt; Anyone have any pointers?
</I>&gt;<i>
</I>&gt;<i> You can deploy your own gtkrc file and load the data from there:
</I>&gt;<i>
</I>&gt;<i> Gtk.Application.Init();
</I>&gt;<i> string filename = &quot;/the/path/to/my.gtkrc&quot;;
</I>&gt;<i> Gtk.Rc.Parse(filename);
</I>&gt;<i>
</I>&gt;<i> or my preferred method: you include the gtkrc file as a resource inside
</I>&gt;<i> your assembly:
</I>&gt;<i>
</I>&gt;<i> Gtk.Application.Init();
</I>&gt;<i> using (Stream stream =
</I>&gt;<i> GetType().Assembly.GetManifestResourceStream(&quot;my.gtkrc&quot;))
</I>&gt;<i> {
</I>&gt;<i> using (TextReader reader = new StreamReader(stream))
</I>&gt;<i> {
</I>&gt;<i> Gtk.Rc.ParseString (reader.ReadToEnd());
</I>&gt;<i> }
</I>&gt;<i> }
</I>&gt;<i>
</I>&gt;<i> Hope this helps.
</I>&gt;<i>
</I>&gt;<i>
</I>&gt;<i> _______________________________________________
</I>&gt;<i> Gtk-sharp-list maillist - <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">Gtk-sharp-list at lists.ximian.com</A>
</I>&gt;<i> &lt;mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">Gtk-sharp-list at lists.ximian.com</A>&gt;
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">http://lists.ximian.com/mailman/listinfo/gtk-sharp-list</A>
</I>&gt;<i>
</I>&gt;<i>
</I>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: &lt;<A HREF="http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20131004/0e7b44b0/attachment.pgp">http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20131004/0e7b44b0/attachment.pgp</A>&gt;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="011325.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI>Next message: <A HREF="011327.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#11326">[ date ]</a>
<a href="thread.html#11326">[ thread ]</a>
<a href="subject.html#11326">[ subject ]</a>
<a href="author.html#11326">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
mailing list</a><br>
</body></html>