Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCL/TK Oval Button

Status
Not open for further replies.

mdolloff

Programmer
Nov 8, 2005
1
0
0
US
Is there anyway to create an oval or round or any other shape button in TCL/TK? I am trying to use a canvas to do so, but I am not sure how to do it exactly. I'm pretty new to tcl so the simpler the better :)
 
Oval Items

An oval is defined by two sets of coordinates that define its bounding box. If the box is square, a circle is drawn. You can set the color of the interior of the oval as well as the outline of the oval. A sampler of ovals is shown in the next example.

Example: Canvas oval items
$c create oval 10 10 80 80 -fill red -width 4
$c create oval 100 10 150 80 -fill blue -width 0
$c create oval 170 10 250 40 -fill black -stipple gray25

Attributes for oval canvas items:
-fill color The color of the interior of the oval.
-outline color The color for the outline of the oval.
-stipple bitmap Stipple pattern for oval fill.
-tags tagList Set of tags for the oval item.
-width width The thickness of the outline.

Arcs
An arc is a section of an oval. The dimensions of the oval are determined by four coordinates that are its bounding box. The arc is then determined by two angles, the start angle and the extent. The region of the oval can be filled or unfilled, and there are three different ways to define the fill region. The pieslice style connects the arc with the center point of the oval. The chord style connects the two endpoints of the arc. The arc style just fills the arc itself and there is no outline.
Attributes for arc canvas items.
-extent degrees The length of the arc in the counter-clockwise direction.
-fill color The color of the interior of the arc region.
-outline color The color of the arc itself.
-start degrees The starting angle of the arc.
-stipple bitmap A stipple pattern for the fill.
-style style pieslice, chord, arc
-tags tagList List of tags for the arc item.
-width num Width, in canvas coordinates, of the arc and outline.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top