gtk.gdk.Regionan object representing a set of pixels on the screen (new in
PyGTK 2.10)Synopsisgtk.gdk.Regiongobject.GBoxedgtk.gdk.Regionget_clipboxemptyequalotherpoint_inxyrect_inrectcopyoffsetdxdyshrinkdxdyunion_with_rectrectintersectsource2unionsource2subtractsource2xorsource2Functionsgtk.gdk.region_rectanglerectangleDescriptionA gtk.gdk.Region
is an objrect holding a set of arbitrary pixels, and is usually used for
clipping graphical operations (see the gtk.gdk.GC.set_clip_region()
method).
Starting with PyGTK 2.14 gtk.gdk.Region objects are
properly comparable. By Python rules, regions (being mutable) are now
unhashable.
Constructorgtk.gdk.RegionReturns :a new gtk.gdk.Region
objectThis constructor is available in PyGTK 2.10 and above.Creates a new gtk.gdk.Region.Methodsgtk.gdk.Region.get_clipboxget_clipboxReturns :returns the smallest rectangle which includes all
of the region.This method is available in PyGTK 2.10 and above.The get_clipbox() method returns the
smallest rectangle which includes the entire region.gtk.gdk.Region.emptyemptyReturns :True if the region is empty.This method is available in PyGTK 2.10 and above.The empty() method returns True if the
region is empty.gtk.gdk.Region.equalequalotherother :a gtk.gdk.RegionReturns :True if the region is equal to
otherThis method is available in PyGTK 2.10 and above.The equal() method returns True if the
region specified by other is equal to this
region.Since PyGTK 2.14 Python comparison operator (==) can be
used for the same result.gtk.gdk.Region.point_inpoint_inxyx :the x coordinate of a point.y :the y coordinate of a point.Returns :True if the point (x,y) is in the
region.This method is available in PyGTK 2.10 and above.The () method returns True if the point
specified by the coordinates x and
y is in a region.gtk.gdk.Region.rect_inrect_inrectrect :a rectangle (gtk.gdk.Rectangle
or 4-tuple representing a rectangle) Returns :a value indicating whether
rectangle is inside or outside the
region.This method is available in PyGTK 2.10 and above.The rect_in() method returns one of the
depending whether
the rectangle specified by rect is inside,
outside, or partly inside this region.gtk.gdk.Region.copycopyReturns :a new gtk.gdk.Region
identical to the regionThis method is available in PyGTK 2.10 and above.The copy() method returns a new gtk.gdk.Region
identical to this region.gtk.gdk.Region.offsetoffsetdxdydx :the distance to move this region
horizontally.dy :the distance to move this region
vertically.This method is available in PyGTK 2.10 and above.The offset() method moves this region
the distance specified by dx and
dy.gtk.gdk.Region.shrinkshrinkdxdydx :the number of pixels to shrink this region
horizontally.dy :the number of pixels to shrink this region
vertically. This method is available in PyGTK 2.10 and above.The shrink() method resizes this region
by the amount specified by dx and
dy. Positive values shrink the region. Negative
values expand it.gtk.gdk.Region.union_with_rectunion_with_rectrectrect :a rectangleThis method is available in PyGTK 2.10 and above.The union_with_rect() method sets the
area of this region to the union of the areas of this region and the
rectangle specified by rect. The resulting area
is the set of pixels contained in either the region or
rect. The value of rect
is either a gtk.gdk.Rectangle
or a 4-tuple containing the position and size of a rectangle.gtk.gdk.Region.intersectintersectsource2source2 :a gtk.gdk.RegionThis method is available in PyGTK 2.10 and above.The intersect() method sets the area of
this region to the intersection of the areas of this region and the
region specified by source2. The resulting area
is the set of pixels contained in both this region and
source2.gtk.gdk.Region.unionunionsource2source2 :a gtk.gdk.Region.This method is available in PyGTK 2.10 and above.The union() method sets the area of
this region to the union of the areas of this region and the region
specified by source2. The resulting area is the
set of pixels contained in either this region or
source2.gtk.gdk.Region.subtractsubtractsource2source2 :a gtk.gdk.Region.This method is available in PyGTK 2.10 and above.The subtract() method sets the area of
this region to the subtraction of the areas of this region and the
region specified by source2. The resulting area
is the set of pixels contained in this region but not in
source2.gtk.gdk.Region.xorxorsource2source2 :a gtk.gdk.Region.This method is available in PyGTK 2.10 and above.The xor() method sets the area of this
region to the exclusive-OR of the areas of this region and the region
specified by source2. The resulting area is the
set of pixels contained in either this region or
source2 but not both.Functionsgtk.gdk.region_rectanglegtk.gdk.region_rectanglerectanglerectangle :a gtk.gdk.Rectangle
or a 4-tuple representing a rectangle.Returns :a new gtk.gdk.RegionThis function is available in PyGTK 2.10 and above.The gtk.gdk.region_rectangle() function
creates a new gtk.gdk.Region
containing the area specified by
rectangle.