mail-archives/mono-osx/2011-May/004323.html

193 строки
9.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] PermFormSelectOnMainThread patch for monomac
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20PermFormSelectOnMainThread%20patch%20for%20monomac&In-Reply-To=BANLkTimpvCqz%2BkNbGRO%2BdSoUMWNof-9g1Q%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="004322.html">
<LINK REL="Next" HREF="004324.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] PermFormSelectOnMainThread patch for monomac</H1>
<B>Maxi Combina</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20PermFormSelectOnMainThread%20patch%20for%20monomac&In-Reply-To=BANLkTimpvCqz%2BkNbGRO%2BdSoUMWNof-9g1Q%40mail.gmail.com"
TITLE="[Mono-osx] PermFormSelectOnMainThread patch for monomac">maxi.combina at passwordbank.com
</A><BR>
<I>Mon May 23 09:48:00 EDT 2011</I>
<P><UL>
<LI>Previous message: <A HREF="004322.html">[Mono-osx] PermFormSelectOnMainThread patch for monomac
</A></li>
<LI>Next message: <A HREF="004324.html">[Mono-osx] PermFormSelectOnMainThread patch for monomac
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4323">[ date ]</a>
<a href="thread.html#4323">[ thread ]</a>
<a href="subject.html#4323">[ subject ]</a>
<a href="author.html#4323">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hi,
I attach the patch in this message.
I am not sure which is the best way to submit the patch, please let me know.
Regards,
Maxi
2011/5/23 Duane Wandless &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">duane at wandless.net</A>&gt;
&gt;<i> Yes adding obj == null ? IntPtr.Zero : obj.Handle to the implementation of
</I>&gt;<i> InvokeOnMainThread is correct. Did you submit that patch?
</I>&gt;<i>
</I>&gt;<i> Duane
</I>&gt;<i>
</I>&gt;<i> On Mon, May 23, 2011 at 8:24 AM, Maxi Combina &lt;
</I>&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">maxi.combina at passwordbank.com</A>&gt; wrote:
</I>&gt;<i>
</I>&gt;&gt;<i> I have tried now and they didn't work.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> However, I found the problem:
</I>&gt;&gt;<i> The patch I sent passes &quot;obj == null ? IntPtr.Zero : obj.Handle&quot;, but the
</I>&gt;&gt;<i> implementation of InvokeOnMainThread() uses &quot;obj.Handle&quot; without checking
</I>&gt;&gt;<i> for null.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> My selector does not take argument, so I use null as argument...
</I>&gt;&gt;<i> and InvokeOnMainThread() fails. If I change
</I>&gt;&gt;<i> monomac/src/Foundation/NSObject.cs:InvokeOnMainThread() to check for null,
</I>&gt;&gt;<i> it works.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> So: could this small change be added? Or is it mandatory to pass a
</I>&gt;&gt;<i> non-null paramter to InvokeOnMainThread()?
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> Thanks!
</I>&gt;&gt;<i> maxi
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> 2011/5/23 Duane Wandless &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">duane at wandless.net</A>&gt;
</I>&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Did you try NSObject.BeginInvokeOnMainThread or
</I>&gt;&gt;&gt;<i> NSObject.InvokeOnMainThread?
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> <A HREF="http://wiki.monotouch.net/HowTo/Threading">http://wiki.monotouch.net/HowTo/Threading</A>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> Duane
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i> On Mon, May 23, 2011 at 6:35 AM, Maxi Combina &lt;
</I>&gt;&gt;&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">maxi.combina at passwordbank.com</A>&gt; wrote:
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> Hi,
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> I need the functionallity of performing a selector on the main thread
</I>&gt;&gt;&gt;&gt;<i> (as WebKit methods can't be invoked from secundary threads). As I could not
</I>&gt;&gt;&gt;&gt;<i> find a way to achieve this with the current MonoMac API, I binded
</I>&gt;&gt;&gt;&gt;<i> NSObject.performSelectorOnMainThread:withObject:waitUntilDone:
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> I would appreciate if this (o a better) patch is included in mainstream.
</I>&gt;&gt;&gt;&gt;<i> Or, if there is another way to perform a selector on the main thread without
</I>&gt;&gt;&gt;&gt;<i> this patch, you could give me some pointer :)
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> Please let me know. Kind regards,
</I>&gt;&gt;&gt;&gt;<i> maxi
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> --
</I>&gt;&gt;&gt;&gt;<i> *Maxi Combina*
</I>&gt;&gt;&gt;&gt;<i> Cell:+1 408 300 3614
</I>&gt;&gt;&gt;&gt;<i> Tel: +1 408 524 1579
</I>&gt;&gt;&gt;&gt;<i> 440 N. Wolfe Road. Sunnyvale. CA. 94085. USA
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> &lt;<A HREF="http://www.passwordbank.com/">http://www.passwordbank.com/</A>&gt;www.PasswordBank.com&lt;<A HREF="http://www.passwordbank.com/">http://www.passwordbank.com/</A>&gt;
</I>&gt;&gt;&gt;&gt;<i> This message and its attachments are sent from PasswordBank, Inc. and
</I>&gt;&gt;&gt;&gt;<i> may contain information that is
</I>&gt;&gt;&gt;&gt;<i> confidential. If you are not the intended recipient, you are prohibited
</I>&gt;&gt;&gt;&gt;<i> from printing, copying, forwarding or
</I>&gt;&gt;&gt;&gt;<i> saving them. Please delete the message and attachments without printing,
</I>&gt;&gt;&gt;&gt;<i> copying, forwarding or saving
</I>&gt;&gt;&gt;&gt;<i> them, and notify the sender immediately. Message transmission is not
</I>&gt;&gt;&gt;&gt;<i> guaranteed to be secure.
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i> _______________________________________________
</I>&gt;&gt;&gt;&gt;<i> Mono-osx mailing list
</I>&gt;&gt;&gt;&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">Mono-osx at lists.ximian.com</A>
</I>&gt;&gt;&gt;&gt;<i> <A HREF="http://lists.ximian.com/mailman/listinfo/mono-osx">http://lists.ximian.com/mailman/listinfo/mono-osx</A>
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;&gt;<i>
</I>&gt;&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> --
</I>&gt;&gt;<i> *Maxi Combina*
</I>&gt;&gt;<i> Cell:+1 408 300 3614
</I>&gt;&gt;<i> Tel: +1 408 524 1579
</I>&gt;&gt;<i> 440 N. Wolfe Road. Sunnyvale. CA. 94085. USA
</I>&gt;&gt;<i>
</I>&gt;&gt;<i> &lt;<A HREF="http://www.passwordbank.com/">http://www.passwordbank.com/</A>&gt;www.PasswordBank.com&lt;<A HREF="http://www.passwordbank.com/">http://www.passwordbank.com/</A>&gt;
</I>&gt;&gt;<i> This message and its attachments are sent from PasswordBank, Inc. and may
</I>&gt;&gt;<i> contain information that is
</I>&gt;&gt;<i> confidential. If you are not the intended recipient, you are prohibited
</I>&gt;&gt;<i> from printing, copying, forwarding or
</I>&gt;&gt;<i> saving them. Please delete the message and attachments without printing,
</I>&gt;&gt;<i> copying, forwarding or saving
</I>&gt;&gt;<i> them, and notify the sender immediately. Message transmission is not
</I>&gt;&gt;<i> guaranteed to be secure.
</I>&gt;&gt;<i>
</I>&gt;&gt;<i>
</I>&gt;<i>
</I>
--
*Maxi Combina*
Cell:+1 408 300 3614
Tel: +1 408 524 1579
440 N. Wolfe Road. Sunnyvale. CA. 94085. USA
&lt;<A HREF="http://www.passwordbank.com/">http://www.passwordbank.com/</A>&gt;www.PasswordBank.com&lt;<A HREF="http://www.passwordbank.com/">http://www.passwordbank.com/</A>&gt;
This message and its attachments are sent from PasswordBank, Inc. and may
contain information that is
confidential. If you are not the intended recipient, you are prohibited from
printing, copying, forwarding or
saving them. Please delete the message and attachments without printing,
copying, forwarding or saving
them, and notify the sender immediately. Message transmission is not
guaranteed to be secure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <A HREF="http://lists.ximian.com/pipermail/mono-osx/attachments/20110523/cfa14071/attachment-0001.html">http://lists.ximian.com/pipermail/mono-osx/attachments/20110523/cfa14071/attachment-0001.html</A>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invokeOnMainThreadNullCheck.patch
Type: text/x-patch
Size: 702 bytes
Desc: not available
Url : <A HREF="http://lists.ximian.com/pipermail/mono-osx/attachments/20110523/cfa14071/attachment-0001.bin">http://lists.ximian.com/pipermail/mono-osx/attachments/20110523/cfa14071/attachment-0001.bin</A>
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="004322.html">[Mono-osx] PermFormSelectOnMainThread patch for monomac
</A></li>
<LI>Next message: <A HREF="004324.html">[Mono-osx] PermFormSelectOnMainThread patch for monomac
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#4323">[ date ]</a>
<a href="thread.html#4323">[ thread ]</a>
<a href="subject.html#4323">[ subject ]</a>
<a href="author.html#4323">[ 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>