1========================================================= 2:mod:`PyObjCTools.AppHelper` -- Work with AppKit 3========================================================= 4 5.. module:: PyObjCTools.AppHelper 6 :synopsis: Work with AppKit 7 8This module exports functions that are useful when working with the 9``AppKit`` framework (or more generally, run loops). 10 11.. function:: callAfter(func, *args, **kwargs) 12 13 Call a function on the main thread. Returns immediately. 14 15.. function:: callLater(delay, func, *args, **kwargs) 16 17 Call a function on the main thread after a delay. Returns immediately. 18 19.. function:: endSheetMethod(method) 20 21 Convert a method to a form that is suitable to use as the delegate callback 22 for sheet methods. 23 24 :rtype: selector 25 26.. function:: stopEventLoop() 27 28 Stops the event loop (if started by ``runConsoleEventLoop``) or sends the 29 ``NSApplication`` a ``terminate:`` message. 30 31.. function:: runConsoleEventLoop(argv=None, installInterrupt=False, mode=NSDefaultRunLoopMode) 32 33 Run a ``NSRunLoop`` in a stoppable way (with ``stopEventLoop``). 34 35.. function:: runEventLoop(argv=None, unexpectedErrorAlert=unexpectedErrorAlert, installInterrupt=None, pdb=None, main=NSApplicationMain) 36 37 Run the event loop using ``NSApplicationMain`` and ask the user if we should 38 continue if an exception is caught. 39 40 This function doesn't return unless it throws an exception. 41