- Tcl Tutorial
- Tcl - Home
- Tcl - Overview
- Tcl - Environment Setup
- Tcl - Special Variables
- Tcl - Basic Syntax
- Tcl - Commands
- Tcl - Data Types
- Tcl - Variables
- Tcl - Operators
- Tcl - Decisions
- Tcl - Loops
- Tcl - Arrays
- Tcl - Strings
- Tcl - Lists
- Tcl - Dictionary
- Tcl - Procedures
- Tcl - Packages
- Tcl - Namespaces
- Tcl - File I/O
- Tcl - Error Handling
- Tcl - Built-in Functions
- Tcl - Regular Expressions
- Tk Tutorial
- Tk - Overview
- Tk - Environment
- Tk - Special Variables
- Tk - Widgets Overview
- Tk - Basic Widgets
- Tk - Layout Widgets
- Tk - Selection Widgets
- Tk - Canvas Widgets
- Tk - Mega Widgets
- Tk - Fonts
- Tk - Images
- Tk - Events
- Tk - Windows Manager
- Tk - Geometry Manager
- Tcl/Tk Useful Resources
- Tcl/Tk - Quick Guide
- Tcl/Tk - Useful Resources
- Tcl/Tk - Discussion
Tk - Canvas Arc Widget
Arc widget is used to draw an arc in canvas. The syntax for arc widget is shown below −
canvasName create arc x1 y1 x2 y2 options
x1 y1 and x2 y2 are the end points of an arc.
Options
The options available for the arc widget are listed below in the following table −
Sr.No. | Syntax & Description |
---|---|
1 | -fill color The fill color fills the arc with the color. |
2 | -start angle The start location in degrees for this arc. The default is 0. |
3 | -extent angle The number of degrees to extend the arc from the start position. The default is 90 degrees. |
4 | -style styleType The style of arc to draw. The options are pieslice, chord and arc. |
A simple example for arc widget is shown below −
#!/usr/bin/wish canvas .myCanvas -background red -width 100 -height 100 pack .myCanvas .myCanvas create arc 10 10 80 80 -fill yellow
When we run the above program, we will get the following output −
tk_canvas_widgets.htm
Advertisements