image as wxMDIParentFrame background?

Thank you, Robin.

I had tried the first method below already, trying both wxClientDC and
wxPaintDC, both inside a paint event and in a handler for a menu item. It is
executed and I can step through it, but for whatever reason it appears to do
nothing. I thought of the possibility of it painting and then being quickly
painted over, but I can see no flicker when forcing an update by bringing
the app to the front. I tried the EVT_ERASE_BACKGROUND method. This event
does not occur in a wxMDIParentFrame (breakpoint never hit).

Have you ever gotten this to work in your own projects?

I am using Python 2.2, wxPython 2.3.2.1, Windows NT 4.0 SP 6.

Thanks,

Bruce

ยทยทยท

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Tuesday, January 14, 2003 4:47 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] image as wxMDIParentFrame background?

brucedickey wrote:

Robin,

Yes, I set the background too, and that may have to do. If I set the
MDIClientWindow as the target of an event, I still need the client

window's

DC at some point, don't I? And I see no way to get it?

Assuming that the handler is a method of your mdi parent:

     def DoSomething(self, evt):
         dc = wxClientDC(self.GetClientWindow())
  dc.DrawBitmap(...) # or whatever

even better, in an EVT_ERASE_BACKGROUND handler, you may get the DC in
the event object:

     def DoSomething(self, evt):
         dc = evt.GetDC()
         if dc is None:
             dc = wxClientDC(self.GetClientWindow())
  dc.DrawBitmap(...) # or whatever

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org