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.Overlay
  • Show Source
  • index
  • modules
  • next
  • previous
  • Home
  • Gallery
  • wx

This view

  • Original page
  • New address

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

phoenix_title wx.Overlay¶

Creates an overlay over an existing window, allowing for manipulations like rubber-banding, etc.

Overlay is implemented internally as a native window shown on top of the window it is used with and it is more efficient to keep the wx.Overlay object around instead of recreating it every time it’s needed, i.e. typically you would have a member variable of type wx.Overlay in your window class.

The overlay is initialized automatically when it is used by wx.DCOverlay or OverlayDC but has to be cleared manually, using its Reset function, when its contents shouldn’t be shown any longer.

Use of this class is shown in the Drawing Sample where pressing the left mouse button and dragging the mouse creates a rubber band effect using wx.Overlay.

See also

wx.DCOverlay, OverlayDC


class_hierarchy Class Hierarchy¶

Inheritance diagram for class Overlay:

Inheritance diagram of Overlay


method_summary Methods Summary¶

__init__

Reset

Clears the overlay without restoring the former state.

SetOpacity

Sets or unsets constant opacity of the overlay window.


api Class API¶

class wx.Overlay(object)¶

Possible constructors:

Overlay() -> None

Creates an overlay over an existing window, allowing for manipulations like rubber-banding, etc.


Methods¶

__init__(self)¶
Return type:

None



Reset(self)¶

Clears the overlay without restoring the former state.

To be done, for example, when the window content has been changed and repainted.

Return type:

None



SetOpacity(self, alpha)¶

Sets or unsets constant opacity of the overlay window.

If alpha is -1 , use per-pixel alpha blending, otherwise use the given alpha value for all pixels.

Parameters:

alpha (int)

Return type:

None

Added in version 4.3/wxWidgets-3.3.0.

Note

Drawing on the overlay window is opaque by default under wxMSW. You have to call SetOpacity(-1) before initializing the overlay and use a graphics context to do the actual drawing if you want per-pixel alpha blending. Or, assuming that SetOpacity(-1) wasn’t called, explicitly set the alpha value (at any time) to change the overlay window’s opacity.

Note

This is currently only implemented for wxMSW and does nothing in the other ports.

© 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.