mail-archives/gtk-sharp-list/2008-February/008402.html

90 строки
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Gtk-sharp-list] Transparent tray icon
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Transparent%20tray%20icon&In-Reply-To=256d62360802040410t4081c6c1ie3fc43dfc0968d64%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="008392.html">
<LINK REL="Next" HREF="008434.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Gtk-sharp-list] Transparent tray icon</H1>
<B>Michael Hutchinson</B>
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20Transparent%20tray%20icon&In-Reply-To=256d62360802040410t4081c6c1ie3fc43dfc0968d64%40mail.gmail.com"
TITLE="[Gtk-sharp-list] Transparent tray icon">m.j.hutchinson at gmail.com
</A><BR>
<I>Thu Feb 7 14:15:06 EST 2008</I>
<P><UL>
<LI>Previous message: <A HREF="008392.html">[Gtk-sharp-list] Transparent tray icon
</A></li>
<LI>Next message: <A HREF="008434.html">[Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#8402">[ date ]</a>
<a href="thread.html#8402">[ thread ]</a>
<a href="subject.html#8402">[ subject ]</a>
<a href="author.html#8402">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>On Feb 4, 2008 7:10 AM, Suco &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">sucotronic at gmail.com</A>&gt; wrote:
&gt;<i> I've find this documentation about tray icons with mono:
</I>&gt;<i> <A HREF="http://www.mono-project.com/GtkSharpNotificationIcon">http://www.mono-project.com/GtkSharpNotificationIcon</A>
</I>&gt;<i>
</I>&gt;<i> But the result tray icon doesn't have a transparent background.
</I>&gt;<i> This is my code
</I>&gt;<i> this.icon = Gdk.Pixbuf.LoadFromResource(&quot;pru.png&quot;);
</I>&gt;<i> Gtk.Image kk = new Gtk.Image(icon.ScaleSimple(24, 24, Gdk.InterpType.Hyper));
</I>&gt;<i>
</I>&gt;<i> EventBox eb = new EventBox();
</I>&gt;<i> eb.Add(kk);
</I>&gt;<i> eb.ButtonPressEvent += new ButtonPressEventHandler(OnTrayClicked);
</I>&gt;<i>
</I>&gt;<i> TrayIcon Icon = new TrayIcon(&quot;pru&quot;);
</I>&gt;<i> Icon.GdkWindow.SetBackPixmap (null, true);
</I>&gt;<i> Icon.ShowAll();
</I>&gt;<i>
</I>&gt;<i> Any idea to solve it?
</I>
That page has unfortunately not been updated in 2.5 years, and it's
likely that some things have changed since it was last updated. It
also makes a lot of X11-specific call, which is not portable. It's
probably possible to make it work, but I'm not surre how. Did you try
it unscaled?
If you're using GTK# 2.10 or later, there's a new cross-platform
StatusIcon class that may be useful to you -- and also a TrayIcon
class that's X11 only but offers the ability to plug in arbitrary
widgets.
--
Michael Hutchinson
<A HREF="http://mjhutchinson.com">http://mjhutchinson.com</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="008392.html">[Gtk-sharp-list] Transparent tray icon
</A></li>
<LI>Next message: <A HREF="008434.html">[Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#8402">[ date ]</a>
<a href="thread.html#8402">[ thread ]</a>
<a href="subject.html#8402">[ subject ]</a>
<a href="author.html#8402">[ 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>