Skip to content

Instantly share code, notes, and snippets.

@joranbeasley
Created September 8, 2015 21:25
Show Gist options
  • Save joranbeasley/a1e4c4e27a951159e6f7 to your computer and use it in GitHub Desktop.
Save joranbeasley/a1e4c4e27a951159e6f7 to your computer and use it in GitHub Desktop.
Threaded wx....
def MyPostEvent(event_name,event_data):
wx.CallAfter(lambda *a:Publisher().sendMessage(event_name,data=event_data))
#then to post an event
MyPostEvent("some_event.i_made_up",{"payload":True})
#then in your main thread subscribe
def OnEventHandler(evt):
print "EVT.data",evt.data
pub = Publisher()
pub.subscribe("some_event.i_made_up",OnEventHandler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment