PyObjCTools.AppHelper – Work with AppKit

This module exports functions that are useful when working with the AppKit framework (or more generally, run loops).

PyObjCTools.AppHelper.callAfter(func, *args, **kwargs)

Call a function on the main thread. Returns immediately.

PyObjCTools.AppHelper.callLater(delay, func, *args, **kwargs)

Call a function on the main thread after a delay. Returns immediately.

PyObjCTools.AppHelper.endSheetMethod(method)

Convert a method to a form that is suitable to use as the delegate callback for sheet methods.

Return type:selector
PyObjCTools.AppHelper.stopEventLoop()

Stops the event loop (if started by runConsoleEventLoop) or sends the NSApplication a terminate: message.

PyObjCTools.AppHelper.runConsoleEventLoop(argv=None, installInterrupt=False, mode=NSDefaultRunLoopMode)

Run a NSRunLoop in a stoppable way (with stopEventLoop).

PyObjCTools.AppHelper.runEventLoop(argv=None, unexpectedErrorAlert=unexpectedErrorAlert, installInterrupt=None, pdb=None, main=NSApplicationMain)

Run the event loop using NSApplicationMain and ask the user if we should continue if an exception is caught.

This function doesn’t return unless it throws an exception.

Previous topic

PyObjCTools.KeyValueCoding – Key-Value Coding API

Next topic

PyObjCTools.Conversion – Convert data structures

This Page