app categories

Upload: caio-loureiro

Post on 22-Feb-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/24/2019 App Categories

    1/2

    =================================================API Description for ``PyObjCTools.AppCategories``=================================================

    Introduction------------

    The module ``PyObjCTools.AppCategories`` defines a number of categories onclasses from the ``AppKit`` framework. These categories introducenew methods that aren't present in that framework.

    To use these new methods use the following code somewhere in your program:

    .. sourcecode:: python

    import PyObjCTools.AppCategories

    Additional methods on ``NSGraphicsContext``-------------------------------------------

    This module defines a method for ``NSGraphicsContext``:

    * ``savedGraphicsState``

    This is a Python context-manager for use with the ``with`` statement.

    Usage:

    .. sourcecode:: python

    with NSGraphicsContext.savedGraphicsState(): pass

    This is equivalent to:

    .. sourcecode:: python

    NSGraphicsContext.saveGraphicsState() try: pass finally:

    NSGraphicsContext.restoreGraphicsState()

    Context-manager for ``NSAnimationContext``------------------------------------------

    Class ``NSAnimationContext`` can be used as the context for a ``with``statement:

    .. sourcecode:: python

    with NSAnimationContext:pass

    This is equivalent to:

    .. sourcecode:: python

  • 7/24/2019 App Categories

    2/2

    NSAnimationContext.beginGrouping()try:

    passfinally:

    NSAnimationContext.endGrouping()