Alex Grönholm avatar Alex Grönholm committed 5380bc3

Added swingRunLater

Comments (0)

Files changed (2)

 v1.0b3
 ======
 
+* ADDED: Decorator wrapper for swingutils.threads.swing.runSwingLater
 * ADDED: DocumentListener shortcuts in swingutils.events
 * FIXED: EmptyNumberFormatter raised an AttributeException
 * CHANGED: @inlineCallbacks now always returns an AsyncToken for consistency

swingutils/threads/swing.py

     """
     runnable = RunnableWrapper(func, args, kwargs)
     SwingUtilities.invokeLater(runnable)
+
+
+def swingRunLater(func):
+    """
+    This is a decorator wrapper for :func:`runSwingLater`.
+
+    This causes the wrapped function to be queued for execution in the
+    Event Dispatch Thread. The call returns immediately, regardless of which
+    thread it was made from.
+
+    """
+    @wraps(func)
+    def wrapper(*args, **kwargs):
+        runSwingLater(func, *args, **kwargs)
+    return wrapper
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.