wxRegion from points

Hi Tim,

Tim Churchard wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi All

I'm having some trouble constructing a wxRegion from a list of points,
currently I have a list of wxPoint that describes the outline of a region.

In the wxPython docs i noticed one of the constructors can take the
number of points and a list of points. I'm using wxGTK.

Can someone give me an example of how to construct a region from points.
Is something like this along the right lines?

        pp.append( wxPoint( 0,0 ) )
        pp.append( wxPoint( 0,350 ) )
        pp.append( wxPoint( 350, 200 ) )
        pp.append( wxPoint( 0, 200 ) )
        pp.append( wxPoint( 0, 0 ) )
        background = wxRegion( len( pp ), pp )
*When this runs it drops out saying: 'TypeError: expected number, got list'

In wxPython 2.5.3.1 there is a wx.RegionFromPoints which seems to work with a list of Points.

Adi