Overlay on a ScrolledWindow

I have a scrolled window and a grid of static bitmaps. I wanted to
highlight the images with an overlay as the mouse moves over the
images.

For some reason, the overlay doesn't draw completely, or is being
drawn behind the bitmaps. I've attached a screen shot of the problem.

Is there a way to force the overlay to the top of everything?

wxPython: 2.8.10.1 (msw-unicode)
Python: 2.6 (r26:66721, Oct 2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)]

CaveTest.py (2.21 KB)

ABCDEF.png

cavescreenshot.jpg

···

--
Josh English
Joshua.R.English@gmail.com
http://joshenglish.livejournal.com

You'll need to draw the bitmaps yourself directly on the scrolled window. The overlay uses the wx.ClientDC you give it, and so it is only able to draw on the scrolledwindow itself, and that is clipped by the child widgets.

···

On 2/20/10 8:56 AM, Josh English wrote:

I have a scrolled window and a grid of static bitmaps. I wanted to
highlight the images with an overlay as the mouse moves over the
images.

For some reason, the overlay doesn't draw completely, or is being
drawn behind the bitmaps. I've attached a screen shot of the problem.

Is there a way to force the overlay to the top of everything?

--
Robin Dunn
Software Craftsman

So I have to draw the bitmaps in a DC as well, instead of as
StaticBitmaps?

Josh

···

On Feb 20, 7:06 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 2/20/10 8:56 AM, Josh English wrote:

> I have a scrolled window and a grid of static bitmaps. I wanted to
> highlight the images with an overlay as the mouse moves over the
> images.

> For some reason, the overlay doesn't draw completely, or is being
> drawn behind the bitmaps. I've attached a screen shot of the problem.

> Is there a way to force the overlay to the top of everything?

You'll need to draw the bitmaps yourself directly on the scrolled
window. The overlay uses the wx.ClientDC you give it, and so it is only
able to draw on the scrolledwindow itself, and that is clipped by the
child widgets.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

Yes, if you want the overlay to appear to be drawing over the bitmaps then they all need to be in the same DC, or in other words, drawn on the same window. wx.Overlay doesn't provide any magic for drawing over the top of other windows.

···

On 2/21/10 5:49 PM, Josh English wrote:

So I have to draw the bitmaps in a DC as well, instead of as
StaticBitmaps?

--
Robin Dunn
Software Craftsman