[Cocoa-sharp] gui from different thread

Dennis Hayes dennisdotnet@yahoo.com
Sun, 23 Jan 2005 19:00:40 -0800 (PST)


--0-626944915-1106535640=:32048
Content-Type: text/plain; charset=us-ascii


> Hmmm, well, I do need to update a status bar inside the thread. Just
> "StatusBar.stringValue = somestring;" Do you think that will be a 
> problem?
>

Touching any gui component from a thread that did not create the componet will cause the entire program to start behaving strangely. This is true on windows, and should be true for all implimentations.

SWF has BeginInvoke that allows other threads to interact with gui components.

I do not have time to tell how to do this now. look at docs or google for examples.

If you cannot find the info you need, let me know and I will try to find time to pull up an eample.

I think you send an event to the gui thread, and the gui thread calls begininvoke, then accesses the gui component.

Just sending the event to the gui code does not work, because the event will be procesed in the context of the thread that sends the event.

Note that begininvolke may not be working yet.

Dennis

		
---------------------------------
Do you Yahoo!?
 Yahoo! Search presents - Jib Jab's 'Second Term'
--0-626944915-1106535640=:32048
Content-Type: text/html; charset=us-ascii

<P>&gt; Hmmm, well, I do need to update a status bar inside the thread. Just<BR>&gt; "StatusBar.stringValue = somestring;" Do you think that will be a <BR>&gt; problem?<BR>&gt;<BR><BR>Touching any gui component from a thread that did not create the componet will cause the entire program to start behaving strangely. This is true on windows, and should be true for all implimentations.</P>
<P>SWF has BeginInvoke that allows other threads to interact with gui components.</P>
<P>I do not have time to tell how to do this now. look at docs or google for examples.</P>
<P>If you cannot find the info you need, let me know and I will try to find time to pull up an eample.</P>
<P>I think you send an event to the gui thread, and the gui thread calls begininvoke, then accesses the gui component.</P>
<P>Just sending the event to the gui code does not work, because the event will be procesed in the context of the thread that sends the event.</P>
<P>Note that begininvolke may not be working yet.</P>
<P>Dennis</P><p>
		<hr size=1>Do you Yahoo!?<br> 
Yahoo! Search presents - <a href="http://us.rd.yahoo.com/evt=30648/*http://movies.yahoo.com/movies/feature/jibjabinaugural.html">Jib Jab's 'Second Term'</a>
--0-626944915-1106535640=:32048--