Thread Safe GUI Update

Bill Glover <[email protected]> Tue, 07 Mar 2006 18:41:44 +0000
Newsgroups gmane.comp.lib.wxwindows.wxnet
Message-ID <[email protected]>
This seems to be a popular topic on the mailing list and despite 
following the discussion so far I am still having problems.

 From the examples given I have done the following:


In my fame class:
-----------------------
_Update1 = Window.UniqueID;
EVT_UPDATE_UI(_Update1, new EventListener(OnDoSomethingElse));


In the thread:
-----------------------
parent.AddPendingEvent(new wx.UpdateUIEvent(update));


This works as expected and I can trigger the OnDoSomethingElse event 
from within the thread.  However I want to pass data from the thread 
back to the main GUI.  Specifically I am looking to update a progress 
bar.  I would have thought that I could create a custom wx.Event and use 
this to pass the data in the EventArgs.

Firstly, is this the right way to go about doing what I'm trying to do?

Secondly, how would I go about creating a custom wx.Event?

Any help would be much appreciated as this has proved a real headache up 
until now.

Thanks in advance.

Bill


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642