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

100 строки
3.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=%3C524BC5BA.5050705%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="011324.html">
<LINK REL="Next" HREF="011326.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=%3C524BC5BA.5050705%40silbermayr.at%3E"
TITLE="[Gtk-sharp-list] Embed Gtk+ theme into app">wolfgang at silbermayr.at
</A><BR>
<I>Wed Oct 2 07:05:30 UTC 2013</I>
<P><UL>
<LI>Previous message: <A HREF="011324.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI>Next message: <A HREF="011326.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#11325">[ date ]</a>
<a href="thread.html#11325">[ thread ]</a>
<a href="subject.html#11325">[ subject ]</a>
<a href="author.html#11325">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>On 2013-10-01 19:05, Weston Weems wrote:
&gt;<i> I'd like to embed a gtk+ theme, so I can effectively skin my app and
</I>&gt;<i> look the same way regardless of what default gtk+ theme is setup.
</I>&gt;<i>
</I>&gt;<i> Is this something I can do? I've read people make comments of using
</I>&gt;<i> resource files etc... but I have yet to hear specific details on this...
</I>&gt;<i> or better yet an example.
</I>&gt;<i>
</I>&gt;<i> Anyone have any pointers?
</I>
You can deploy your own gtkrc file and load the data from there:
Gtk.Application.Init();
string filename = &quot;/the/path/to/my.gtkrc&quot;;
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(&quot;my.gtkrc&quot;))
{
using (TextReader reader = new StreamReader(stream))
{
Gtk.Rc.ParseString (reader.ReadToEnd());
}
}
Hope this helps.
-------------- 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/20131002/bc9f01db/attachment.pgp">http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20131002/bc9f01db/attachment.pgp</A>&gt;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="011324.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI>Next message: <A HREF="011326.html">[Gtk-sharp-list] Embed Gtk+ theme into app
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#11325">[ date ]</a>
<a href="thread.html#11325">[ thread ]</a>
<a href="subject.html#11325">[ subject ]</a>
<a href="author.html#11325">[ 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>