Hi everbody,
first of all *many* thanks to the wxPyhton (and wxWindows) builders.
I just started working with python / wxPython for a week but it is
very easy to learn and to use. Programming is fun again 
Now to the question;
I have a scrolled window where I draw on a device context
If I use the scrollbars to move the 'wxScrolledWindow' the screen is
not refreshed correctly
(see
http://www.nedlinux.nl/~delphiro/images/before.png
and
http://www.nedlinux.nl/~delphiro/images/after.png
both 7kB)
Is this a known problem or does anyone have a workaround?
(will this be solved in future releases ?)
[my code]
EVT_PAINT(self.pb, self.OnPBPaint) #where pb = the wxScrolledWindow)
...
def OnPBPaint(self, event):
dc = wxPaintDC(self.pb)
self.pb.PrepareDC(dc)
dc.BeginDrawing()
self.ShowPBGrid( dc )
self.ShowPBPoints( dc )
dc.EndDrawing()
...
def ShowPBGrid( self, dc ):
dc.SetPen(wxPen(wxBLACK, 1, wxSOLID))
xs = self.pb.GetViewStart()[0] * self.dgrid
ys = self.pb.GetViewStart()[1] * self.dgrid
for x in range( xs, xs + self.nb.GetSizeTuple()[0], self.dgrid ):
for y in range( ys, ys + self.nb.GetSizeTuple()[1], self.dgrid ):
dc.DrawPoint( x, y )
...
def ShowPBPoints( self, dc ):
dc.SetPen(wxPen(wxRED, 1, wxSOLID))
left = self.pb.GetViewStart()[0] * self.pb.GetScrollPixelsPerUnit()[0]
top = self.pb.GetViewStart()[1] * self.pb.GetScrollPixelsPerUnit()[1]
right = left + self.pb.GetClientSize()[0]
bottom = top + self.pb.GetClientSize()[1]
for id, p in self.geo.points:
px, py = self.GeometryToPB( p[0], p[1] )
if px > left and px < right and py > top and py < bottom:
dc.DrawCircle( px, py, 2 )
dc.DrawText( "%d" % id, px - 5, py + 5 )
[/my code]
Thanks in advance,
Rob