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.

smoothThe default outline uses straight lines to connectthe vertices, and you can set this option to 0 to getthat behavior. If you set it to 1, you get a continuousspline curve. Moreover, if you set smooth to 1, youcan make any segment straight by duplicating thecoordinates at each end of that segment.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 render the fill color as a stippled pattern, setthis option to a bitmap that specifies the stipplingpattern, such as "gray25".tagsThe tags to be associated with the object, as a sequenceof strings.width Width of the outline; defaults to 1.5.7 The canvas rectangle objectEach rectangle is specified as two points: (x 0 ; y 0 ) is the top left corner, and (x 1 ; y 1 ) is thebottom right corner.Rectangles are drawn in two parts: The outline lies outside the canvas on its top and left sides, but inside the canvas onits bottom and right side. The default appearance is a 1-pixel-wide black outline. The fill is the area inside the outline. Its default appearance is transparent.To create a rectangle object on canvas C:id = C.create_rectangle ( x0, y0, x1, y1, *options )This constructor returns the integer ID number of the rectangle on that canvas. Optionsinclude:filloutlinestippletagswidthBy default, the interior of a rectangle is empty, andyou can get this behavior by setting fill to "". Youcan also set the option to a color.The color of the border. Default is black.If fill is set to a color, the default pattern is solid.Set stipple to a bitmap (such as "gray20") to geta stippled pattern.The tags to be associated with the object, as a sequenceof strings.Width of the border. Default is 1 pixel.New Mexico Tech Computer Center <strong>Tkinter</strong> <strong>reference</strong>: The Canvas widget Page 21

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

Saved successfully!

Ooh no, something went wrong!