4.6 Graphics Context

All Graphics Context objects have methods that perform drawing operations. They are listed here, with the argument types they expect. XPoint is a pair of integers; XRectangle is a tuple of four integers; XSegment is a tuple of four integers; XArc is a tuple of six integers; <type>[] stands for a list of <type> objects.

All GC objects have data attributes representing the individual values. These are gc.line_width, gc.line_style, etc. (The dash attribute is not supported.) These attributes can be assigned to if the GC object is writable.

The Pixmap arguments are Pixmap objects; the Font arguments are Font objects; the Image arguments are Image objects.

Graphics Context objects (gc_objects) have the following methods and variables:

arc_mode
Field in XGCValues structure.

background
Field in XGCValues structure.

cap_style
Field in XGCValues structure.

clip_mask
Field in XGCValues structure.

clip_x_origin
Field in XGCValues structure.

clip_y_origin
Field in XGCValues structure.

dash_offset
Field in XGCValues structure.

file_style
Field in XGCValues structure.

fill_rule
Field in XGCValues structure.

font
Field in XGCValues structure.

foreground
Field in XGCValues structure.

function
Field in XGCValues structure.

graphics_exposures
Field in XGCValues structure.

join_style
Field in XGCValues structure.

line_style
Field in XGCValues structure.

line_width
Field in XGCValues structure.

plane_mask
Field in XGCValues structure.

stipple
Field in XGCValues structure.

subwindow_mode
Field in XGCValues structure.

tile
Field in XGCValues structure.

ts_x_origin
Field in XGCValues structure.

ts_y_origin
Field in XGCValues structure.

ChangeGC( gc_dict)
This function corresponds with XChangeGC.

DrawArc( x, y, width, height, angle1, angle2)
This function corresponds with XDrawArc.

DrawArcs( XArc[])
This function corresponds with XDrawArcs.

DrawImageString( x, y, string)
This function corresponds with XDrawImageString.

DrawLine( x1, y1, x2, y2)
This function corresponds with XDrawLine.

DrawLines( XPoint[], mode)
This function corresponds with XDrawLines.

DrawPoint( x, y)
This function corresponds with XDrawPoint.

DrawPoints( XPoint[], mode)
This function corresponds with XDrawPoints.

DrawRectangle( x, y, width, height)
This function corresponds with XDrawRectangle.

DrawRectangles( XRectangle[])
This function corresponds with XDrawRectangles.

DrawSegments( XSegment[])
This function corresponds with XDrawSegments.

DrawString( x, y, string)
This function corresponds with XDrawString.

FillArc( x, y, width, height, angle1, angle2)
This function corresponds with XFillArc.

FillArcs( XArc[])
This function corresponds with XFillArcs.

FillPolygon( XPoint[], shape, mode)
This function corresponds with XFillPolygon.

FillRectangle( x, y, width, height)
This function corresponds with XFillRectangle.

FillRectangles( XRectangle[])
This function corresponds with XFillRectangles.

PutImage( Image, src_x, src_y, dest_x, dest_y, width, height)
This function corresponds with XPutImage.

SetArcMode( arc_mode)
This function corresponds with XSetArcMode.

SetBackground( background)
This function corresponds with XSetBackground.

SetClipMask( Pixmap)
This function corresponds with XSetClipMask.

SetClipOrigin( clip_x_origin, clip_y_origin)
This function corresponds with XSetClipOrigin.

SetClipRectangles( clip_x_origin, clip_y_origin, XRectangle[], ordering)
This function corresponds with XSetClipRectangles.

SetDashes( dash_offset, dash_list)
This function corresponds with XSetDashes.

SetFillRule( fill_rule)
This function corresponds with XSetFillRule.

SetFillStyle( fill_style)
This function corresponds with XSetFillStyle.

SetFont( font_object)
This function corresponds with XSetFont.

SetForeground( foreground)
This function corresponds with XSetForeground.

SetFunction( function)
This function corresponds with XSetFunction.

SetGraphicsExposures( graphics_exposure)
This function corresponds with XSetGraphicsExposures.

SetLineAttributes( line_width, line_style, cap_style, join_style)
This function corresponds with XSetLineAttributes.

SetPlaneMask( plane_mask)
This function corresponds with XSetPlaneMask.

SetRegion( region)
This function corresponds with XSetRegion.

SetState( foreground, background, function, plane_mask)
This function corresponds with XSetState.

SetStipple( stipple)
This function corresponds with XSetStipple.

SetSubwindowMode( subwindow_mode)
This function corresponds with XSetSubwindowMode.

SetTSOrigin( ts_x_origin, ts_y_origin)
This function corresponds with XSetTSOrigin.

SetTile( tile)
This function corresponds with XSetTile.