Skip to main content

Allow wxPython object methods to be called from any thread.

Project description

wxAnyThread: allow methods on wxPython objects to be called from any thread

In wxPython, methods that alter the state of the GUI are only safe to call from
the thread running the main event loop. Other threads must typically post
events to the GUI thread instead of invoking methods directly.

This module provides an easy way to invoke wxPython object methods safely
from any thread. Basically, the standard event-based solution is wrapped
into a decorator named "anythread", which can be applied to methods to make
them safe to call from any thread, like so:

class MyFrame(wx.Frame):

def ShowFancyStuff():
...does some GUI manipulation...

The ShowFancyStuff method can now be directly invoked from any thread.
The calling thread will block while the main GUI thread performs the method,
and will then receive a return value or exception as appropriate.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wxAnyThread-0.1.1.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

wxAnyThread-0.1.1-py2.5.egg (4.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page