Order of events in wxPython

I'm having a little trouble drawing something in front of a wxWindow.

Basically what I want to do is have a block floating on top of a
wxWindow. The way I did that was to override EVT_PAINT so that it
draws the block every time it draws the shape. Then I call
event.Skip() so that it still draws the shape.

Trouble is that it draws the shape over the block I've just made. Is
there any way that I can have it drawing the shape as usual and only
THEN drawing my block.

Much thanks
Stephen Emslie

···

_______________________________________________________________________
LOOK GOOD, FEEL GOOD - WWW.HEALTHIEST.CO.ZA

Cool Connection, Cool Price, Internet Access for R59 monthly @ WebMail
http://www.webmail.co.za/dialup/

Stephen Emslie wrote:

I'm having a little trouble drawing something in front of a wxWindow.

Basically what I want to do is have a block floating on top of a
wxWindow. The way I did that was to override EVT_PAINT so that it
draws the block every time it draws the shape. Then I call
event.Skip() so that it still draws the shape.

Trouble is that it draws the shape over the block I've just made. Is
there any way that I can have it drawing the shape as usual and only
THEN drawing my block.

Yep, catch EVT_PAINT and make you handler like this:

  def OnPaint(self, evt):
    wxCallAfter(self.DrawMyThing)
    evt.Skip()

Then the DrawMyThing method will be called sometime shortly after the paint event has been handled.

···

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