21.6 Shortcut functions for the default canvas

For the default canvas ( see Section 21.3), you can call the following functions provided in the canvas module directly:

line( linestyle, x1, y1, x2, y2)
Calls the method with the same name on the default canvas object.

polygon( linestyle, fillstyle, [(x1,y1), ..., (xn, yn)])
Calls the method with the same name on the default canvas object.

rectangle( linestyle, fillstyle, x1, y1, x2, y2, shadow=None)
Calls the method with the same name on the default canvas object. Parameter shadow is either None or tuple (xdelta, ydelta, shadowstyle). If non-None, a shadow of shadowstyle ( see Section 16) is drawn beneath the polygon at the offset of (xdelta, ydelta).

ellipsis( linestyle, fillstyle, x, y, radius, y_elongation=1, start=0, end=360, shadow=None)
Calls the method with the same name on the default canvas object. Parameter shadow is either None or tuple (xdelta, ydelta, shadowstyle). If non-None, a shadow of shadowstyle ( see Section 16) is drawn beneath the polygon at the offset of (xdelta, ydelta).

round_rectangle( linestyle, fillstyle, x1, y2, x2, y2,radius, shadow=None)
Calls the method with the same name on the default canvas object. Parameter shadow is either None or tuple (xdelta, ydelta, shadowstyle). If non-None, a shadow of shadowstyle ( see Section 16) is drawn beneath the polygon at the offset of (xdelta, ydelta).

curve( linestyle, [(x1,y2), ..., (xn, yn)])
Calls the method with the same name on the default canvas object.

show( x, y, text)
Calls the method with the same name on the default canvas object.

verbatim( str)
Calls the method with the same name on the default canvas object.

default_canvas( )
Return the default canvas.

clip( x1, y1, x2, y2)
Calls the method with the same name on the default canvas object.

clip_ellipsis( x, y, radius, y_elongation)
Calls the method with the same name on the default canvas object.

clip_polygon( [(x1,y2),(x2,y2), ..., (xn, yn)])
Calls the method with the same name on the default canvas object.

endclip( )
Calls the method with the same name on the default canvas object.