Friday, May 6, 2011

wxPython: Drawing inside a ScrolledPanel

I'm using a PaintDC to draw inside a ScrolledPanel. However, when I run the program, the scroll bars have no effect. They're the right size, but the picture doesn't move when you scroll with them.

I figured I may have to convert from logical to device coordinates. I tried x=dc.LogicalToDeviceX(x) and y=dc.LogicalToDeviceY(y), but there was no effect.

Any ideas?

From stackoverflow
  • Got it:

    (new_x,new_y)=self.CalcScrolledPosition((old_x,old_y))
    

    Where self is the ScrolledPanel.

0 comments:

Post a Comment