12.07.2015 Views

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

Tkinter reference: A GUI for Python

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.4 The canvas line objectIn general, a line can consist of any number of segments connected end to end, and eachsegment can be straight or curved. To create a canvas line object on a canvas C, use:C.create_line ( x0, y0, x1, y1, ..., xn, yn, *options )The line goes through the series of points (x0; y0); (x1; y1); : : : ; (xn; yn). Options include:arrowarrowshapeThe default is <strong>for</strong> the line to have no arrowheads.Set this option to FIRST to get an arrowhead atthe (x0; y0) end of the line; set it to "last" to getan arrowhead at the far end; set it to "both" <strong>for</strong>arrowheads at both ends.A tuple (d1, d2, d3) that describes the shape ofthe arrowheads added by the arrow option. Defaultis (8,10,3).5.5 The canvas oval objectfill The color to use in drawing the line. Default is"black".smoothIf true, the line is drawn as a series of parabolicsplines fitting the point set. Default is false, whichrenders the line as a set of straight segments.splinestepsIf the smooth option is true, each spline is renderedas a number of straight line segments. Thesplinesteps option specifies the number of segmentsused to approximate each section of the line;the default is 12.stippleTo draw a stippled line, set this option to abitmap that specifies the stippling pattern, such as"gray25".tagsThe tags to be associated with the object, as a sequenceof strings.widthThe line’s width. Default is 1 pixel.Ovals, mathematically, are ellipses, including circles as a special case. The ellipse is fit intoa rectangle defined by the coordinates (x 0 ; y 0 ) of the top left corner and the coordinates(x 1 ; y 1 ) of the bottom right corner:New Mexico Tech Computer Center <strong>Tkinter</strong> <strong>reference</strong>: The Canvas widget Page 19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!