mail-archives/mono-osx/2010-August/003037.html

81 строка
3.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] Gtk# StatusIcon and Events
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20Gtk%23%20StatusIcon%20and%20Events&In-Reply-To=1280497340532-2307970.post%40n4.nabble.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Next" HREF="003038.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] Gtk# StatusIcon and Events</H1>
<B>KenKen</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20Gtk%23%20StatusIcon%20and%20Events&In-Reply-To=1280497340532-2307970.post%40n4.nabble.com"
TITLE="[Mono-osx] Gtk# StatusIcon and Events">kenneth at hexad.dk
</A><BR>
<I>Sun Aug 1 09:14:14 EDT 2010</I>
<P><UL>
<LI>Next message: <A HREF="003038.html">[Mono-osx] Couldn't get CocoaSharp 0.9.4 to configure with Mono 2 (fixed?)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3037">[ date ]</a>
<a href="thread.html#3037">[ thread ]</a>
<a href="subject.html#3037">[ subject ]</a>
<a href="author.html#3037">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>
Yet another followup :).
The pastebin code works for the small example, but as soon as the code
starts to show a form, all sorts of semi-random errors occur, so that is NOT
the way to go.
After working some more on the problem, I figured out that windows forms can
display just fine, without calling System.Windows.Forms.Application.Run().
So, instead of calling that, I can simply call Gtk.Application.Run(), and
the trayicon works and forms are showing. The only remaining problem is the
Winforms context menu, which refuses to show unless there is also a visible
window.
I have updated the TrayIconWrapper on the link previously posted to also
wrap the ContextMenuStrip with Gtk.Menu items. For most standard uses, the
TrayIconWrapper should now emulate a MWF trayicon, and my initial problems
are now solved.
Hope the code is of use to those attempting to port a MWF based application:
<A HREF="http://code.google.com/p/duplicati/source/browse/sandboxes/Kenneth/MacSupport/Duplicati/GUI/TrayIconWrapper.cs">http://code.google.com/p/duplicati/source/browse/sandboxes/Kenneth/MacSupport/Duplicati/GUI/TrayIconWrapper.cs</A>
Regards, Kenneth
--
View this message in context: <A HREF="http://mono.1490590.n4.nabble.com/Gtk-StatusIcon-and-Events-tp2295916p2309422.html">http://mono.1490590.n4.nabble.com/Gtk-StatusIcon-and-Events-tp2295916p2309422.html</A>
Sent from the Mono - OSX mailing list archive at Nabble.com.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Next message: <A HREF="003038.html">[Mono-osx] Couldn't get CocoaSharp 0.9.4 to configure with Mono 2 (fixed?)
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3037">[ date ]</a>
<a href="thread.html#3037">[ thread ]</a>
<a href="subject.html#3037">[ subject ]</a>
<a href="author.html#3037">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>