.. include:: headings.inc .. _DCPenChanger: ========================================================================================================================================== |phoenix_title| **DCPenChanger** ========================================================================================================================================== :ref:`DCPenChanger` is a small helper class for setting a pen on a :ref:`DC` and unsetting it automatically in the destructor, restoring the previous one. .. seealso:: :meth:`DC.SetPen` , :ref:`DCFontChanger`, :ref:`DCTextColourChanger`, :ref:`DCBrushChanger`, :ref:`DCClipper` | |class_hierarchy| Inheritance Diagram ===================================== Inheritance diagram for class **DCPenChanger** .. raw:: html

Inheritance diagram of DCPenChanger

| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~DCPenChanger.__init__` Sets `pen` on the given `dc`, storing the old one. :meth:`~DCPenChanger.__enter__` :meth:`~DCPenChanger.__exit__` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: DCPenChanger(object) DCPenChanger is a small helper class for setting a pen on a DC and unsetting it automatically in the destructor, restoring the previous one. **Possible constructors**:: DCPenChanger(dc, pen) .. method:: __init__(self, dc, pen) Sets `pen` on the given `dc`, storing the old one. :param `dc`: The DC where the pen must be temporary set. :type `dc`: DC :param `pen`: The pen to set. :type `pen`: Pen .. method:: __enter__(self) .. method:: __exit__(self, exc_type, exc_val, exc_tb)