[wxPython] drawing with logical units

Hi:

I am drawing on a wxScrolledWindow using the following commands which seem to work:

···

----------------------------
x, y = event.GetPositionTuple()
dc = wxClientDC( self )
dc.SetMapMode( wxMM_METRIC )
self.PrepareDC( dc )
pos = dc.DeviceToLogicalX( x ), dc.DeviceToLogicalY( y )
----------------------------

In my update window method I have a customized onPaint as follows:
----------------------------
data = self.doc.getDData()
dc = wxPaintDC( self )
self.PrepareDC( dc )
dc.BeginDrawing()
for object in data:
  colour = object.getColour()
         lWidth = object.getPWidth()
         points = object.getCoords()
         pen = wxPen( wxNamedColour( colour ), lWidth, wxSOLID )
         dc.SetPen( pen )
         for line in points:
           x1, y1, x2, y2 = line
                 pos = ( dc.LogicalToDeviceX( x2 ), dc.LogicalToDeviceY( y2 ),
                   dc.LogicalToDeviceX( x1 ), dc.LogicalToDeviceY( y1 ) )
                 apply( dc.DrawLine, pos )
         dc.EndDrawing()
----------------------------

This does not work. My drawn items get drawn correctly but on update, they do not appear correctly.

Does anybody know why? Please help
--

--
Kene Meniru
___________________________________________________________
--keMen@illom.net--