GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Table of Contents
  • wx.DCClipper
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx

This view

  • Original page
  • New address

GeezerVison is showing docs.wxpython.org — wx.DCClipper — wxPython 4.3.2 Docs

phoenix_title wx.DCClipper¶

wx.DCClipper is a helper class for setting a clipping region on a wx.DC during its lifetime.

An object of wx.DCClipper class is typically created on the stack so that it is automatically destroyed when the object goes out of scope. A typical usage example:

def MyFunction(dc):

    clip = wx.DCClipper(dc, rect)
    # ... drawing functions here are affected by clipping rect ...


def OtherFunction():

    dc = wx.DC()
    MyFunction(dc)
    # ... drawing functions here are not affected by clipping rect ...

Note

Since 3.1.1 wx.DCClipper restores the previously active clipping region when it is destroyed. Previously it reset clipping on the associated wx.DC and this has to be taken into account explicitly in previous wxWidgets versions.

See also

wx.DC.SetClippingRegion , wx.DCFontChanger, wx.DCTextColourChanger, wx.DCPenChanger, wx.DCBrushChanger


class_hierarchy Class Hierarchy¶

Inheritance diagram for class DCClipper:

Inheritance diagram of DCClipper


method_summary Methods Summary¶

__init__

Sets the clipping region to the specified region/coordinates.

__enter__

__exit__


api Class API¶

class wx.DCClipper(object)¶

Possible constructors:

DCClipper(dc, region) -> None

DCClipper(dc, rect) -> None

DCClipper(dc, x, y, w, h) -> None

DCClipper is a helper class for setting a clipping region on a DC during its lifetime.


Methods¶

__init__(self, *args, **kw)¶

Sets the clipping region to the specified region/coordinates.

The clipping region is automatically unset when this object is destroyed.

overload Overloaded Implementations:



__init__ (self, dc, region)

Parameters:
  • dc (wx.DC)

  • region (wx.Region)

Return type:

None



__init__ (self, dc, rect)

Parameters:
  • dc (wx.DC)

  • rect (wx.Rect)

Return type:

None



__init__ (self, dc, x, y, w, h)

Parameters:
  • dc (wx.DC)

  • x (int)

  • y (int)

  • w (int)

  • h (int)

Return type:

None





__enter__(self)¶


__exit__(self, exc_type, exc_val, exc_tb)¶
© Copyright 2012-2026, The wxPython Team. Created using Sphinx 9.1.0 and the python-docs-theme.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.