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.

.xview_scroll ( n, what )Same as .xview(SCROLL, n, what)..yview ( MOVETO, fraction ).yview ( SCROLL, n, what ).yview_moveto ( fraction ).yview_scroll ( n, what )These are the same as the .xview() and related methods, only <strong>for</strong> vertical scrolling.5.1 The canvas arc objectAn “arc object” on a canvas, in its most general <strong>for</strong>m, is a wedge-shaped slice taken outof an ellipse. This includes whole ellipses and circles as special cases. See The canvas ovalobject, below, <strong>for</strong> more on the geometry of the ellipse drawn.To create an arc object on a canvas C, use:id = C.create_arc ( x0, y0, x1, y1, *options )The constructor returns the integer ID number of the new arc object on canvas C.Point (x0; y0) is the top left corner and (x1; y1) the lower right corner of a rectangle intowhich the ellipse is fit. If this rectangle is square, you get a circle.The options include:extent Width of the slice in degrees. The slice starts atthe angle given by the start option and extendscounterclockwise <strong>for</strong> extent degrees.fillThe default appearance of an arc is that the interioris transparent, and a value of "" will select thisbehavior. You can also set this option to any colorand the interior of the arc will be filled with thatcolor.outlineThe color of the border around the outside of theslice. Default is black.outlinestipple If the outline option is used, this option specifies abitmap used to stipple the border. Default is black,and that default can be specified by setting thisoption to "".startStarting angle <strong>for</strong> the slice, in degrees, measuredfrom the +x direction. If omitted, you get the entireellipse (or circle).stippleA bitmap indicating how the interior fill of the arcwill be stippled. Default is "" (solid). Typical value:"gray25". Has no effect unless fill has been setto some color.styleThe default is to draw the whole arc; use valuePIESLICE <strong>for</strong> this style. Set it to ARC to draw onlythe circular arc at the edge of the slice. Set it toCHORD to draw the circular arc and the chord (astraight line connecting the endpoints of the arc).New Mexico Tech Computer Center <strong>Tkinter</strong> <strong>reference</strong>: The Canvas widget Page 17

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

Saved successfully!

Ooh no, something went wrong!