[wxPython] Drawing while dragging

Hi,
  I'm trying to draw a rectangle just like in paintbrush.(I mean dragging it to the coordinates you want).

  OnLeftDown:
      Start drawing the rectangle...
  OnLeftUp:
      Stop drawing the rectangle...
  OnMotion:
      Delete the previous drawn rect(wxXOR)...
      Update the coords and draw it again...

I've tried a lot but couldnt achieve(made one but flickered a lot)
Can you direct me to a source.

Thanks.

Make a difference, help support the relief efforts in the U.S.
http://clubs.lycos.com/live/events/september11.asp