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):
@anythread
def ShowFancyStuff():
...does some GUI manipulation...
The ShowFancyStuff method can now be directly invoked from any thread.
The thread will block while the main GUI thread performs the method.
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):
@anythread
def ShowFancyStuff():
...does some GUI manipulation...
The ShowFancyStuff method can now be directly invoked from any thread.
The thread will block while the main GUI thread performs the method.
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.0.tar.gz
(2.0 kB
view details)
Built Distribution
wxAnyThread-0.1.0-py2.5.egg
(4.1 kB
view details)
File details
Details for the file wxAnyThread-0.1.0.tar.gz
.
File metadata
- Download URL: wxAnyThread-0.1.0.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a910d65c00b92f111e70b1305bf0c66d6a915696225d209982ec682d8d81262e |
|
MD5 | 3f9f605b44dfafaa7f4f1d1bc10be34e |
|
BLAKE2b-256 | 75a2b4d1baf02670ad8228aa354229543f26370aef47e59166358c29d99b25d1 |
File details
Details for the file wxAnyThread-0.1.0-py2.5.egg
.
File metadata
- Download URL: wxAnyThread-0.1.0-py2.5.egg
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db9c600aac0ab1c7ac4db2b200d430509b46530ff9b5ddd73ba9fd080d7bf522 |
|
MD5 | e0d4050bb8c54d12daee46507d2eb041 |
|
BLAKE2b-256 | b2804cb1f735cb01e72062686a344297ea0739db63c1467e961a3d682056df02 |