[wxPython] WXRegion

We are trying to use wxRegion.Intersect, byt it doesn't seem to work as described in wxWindows Help.

We have defined two regions that do intersect:

            ptRegion = wxRegionFromPoints(PTdrawlist)
            ccRegion = wxRegionFromPoints(CCdrawlist)

Using intersect with one of the regions as an argument:
            
  ccRegion.Intersect(ptRegion):

won't work (Type Error: takes 5 arg. 2 given):

If we use GetBox instead:

            x,y,width,height = ptRegion.GetBox()
            ccRegion.Intersect(x,y,width,height):

we don't get any errors but at use of Intersect the ccRegion is set to zero, i.e. GetBox after call to Intersect:
                        
            x,y,width,height = ccRegion.GetBox()

returns 0,0,0,0.

Moreover, using GetBox makes it impossible to use regions that's not rectangular !?

Shouldn't wxRegion.Intersect() work with an region as an argument ?
and should not this region be able to be a region created by wxRegionFromPoints() (i.e. not necessarily a rectangle) ?

regards
Manne

Freyland Manne wrote:

Shouldn't wxRegion.Intersect() work with an region as an argument ?

There is a IntersectRegion method that does.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!