1<TITLE>watch - Create and manipulate time with a watch widgets</TITLE>
2<H1>watch - Create and manipulate time with a watch widgets</H1>
3
4</pre><H2>SYNOPSIS</H2>
5<B>watch<I> <I>pathName </I>?<I>options</I>?
6</pre><H2>INHERITANCE</H2>
7itk::Widget &lt;- Watch
8
9</pre><H2>STANDARD OPTIONS</H2>
10<P>
11<table cellpadding=5>
12<td valign=top>
13<B>background</B><br>
14</td>
15<td valign=top>
16<B>cursor</B><br>
17</td>
18<td valign=top>
19<B>foreground</B><br>
20</td>
21<td valign=top>
22<B>relief</B><br>
23</td>
24</table>
25<P>
26See the <A HREF="http://www.sco.com/Technology/tcl/man/tk_man/options.n.html"> "options" </A> manual entry for details on the standard options.
27</pre><H2>ASSOCIATED OPTIONS</H2>
28<P>
29See the "Canvas" manual entry for details on the above associated options.
30
31</pre><H2>WIDGET-SPECIFIC OPTIONS</H2>
32<P>
33<pre>
34Name:                   <B>clockColor</B>
35Class:                  <B>ColorfR
36Command-Line Switch:	<B>-clockcolor</B>
37</pre>
38<UL>
39Fill color for the main oval encapsulating the watch, in any of the forms
40acceptable to <B>Tk_GetColor</B>.  The default is "White".
41</UL>
42<table cellpadding=5>
43<td valign=top>
44<P><br>
45<B>BitmapfR<br>
46</td>
47<td valign=top>
48Name:<br>
49Command-Line<br>
50</td>
51<td valign=top>
52<B>clockStipple</B><br>
53Switch:<br>
54</td>
55<td valign=top>
56Class:<br>
57<B>-clockstipple</B><br>
58</td>
59</table>
60<UL>
61Bitmap for the main oval encapsulating the watch, in any of the forms
62acceptable to <B>Tk_GetBitmap</B>.  The default is "".
63</UL>
64<P>
65<pre>
66Name:                   <B>height</B>
67Class:                  <B>Height</B>
68Command-Line Switch:	<B>-height</B>
69</pre>
70<UL>
71Specifies the height of the watch widget in any of the forms 
72acceptable to <B>Tk_GetPixels</B>.  The default height is 175 pixels.
73</UL>
74<P>
75<pre>
76Name:                   <B>hourColor</B>
77Class:                  <B>ColorfR
78Command-Line Switch:	<B>-hourcolor</B>
79</pre>
80<UL>
81Fill color for the hour hand, in any of the forms acceptable to <B>Tk_GetColor</B>.
82The default is "Red".
83</UL>
84<P>
85<pre>
86Name:                   <B>hourRadius</B>
87Class:                  <B>Radius</B>
88Command-Line Switch:	<B>-hourradius</B>
89</pre>
90<UL>
91Specifies the radius of the hour hand as a percentage of the radius
92from the center to the out perimeter of the clock.
93The value must be a fraction &lt;= 1.  The default is ".5".
94</UL>
95<P>
96<pre>
97Name:                   <B>minuteColor</B>
98Class:                  <B>ColorfR
99Command-Line Switch:	<B>-minutecolor</B>
100</pre>
101<UL>
102Fill color for the minute hand, in any of the forms acceptable to <B>Tk_GetColor</B>.
103The default is "Yellow".
104</UL>
105<P>
106<pre>
107Name:                   <B>minuteRadius</B>
108Class:                  <B>Radius</B>
109Command-Line Switch:	<B>-minuteradius</B>
110</pre>
111<UL>
112Specifies the radius of the minute hand as a percentage of the radius
113from the center to the out perimeter of the clock.
114The value must be a fraction &lt;= 1.  The default is ".8".
115</UL>
116<P>
117<pre>
118Name:                   <B>pivotColor</B>
119Class:                  <B>ColorfR
120Command-Line Switch:	<B>-pivotcolor</B>
121</pre>
122<UL>
123Fill color for the circle in which the watch hands rotate
124in any of the forms acceptable to <B>Tk_GetColor</B>.
125The default is "White".
126</UL>
127<P>
128<pre>
129Name:                   <B>pivotRadius</B>
130Class:                  <B>Radius</B>
131Command-Line Switch:	<B>-pivotradius</B>
132</pre>
133<UL>
134Specifies the radius of the circle in which the watch hands rotate
135as a percentage of the radius.  The value must be a fraction &lt;= 1.
136The default is ".1".
137</UL>
138<P>
139<pre>
140Name:                   <B>secondColor</B>
141Class:                  <B>ColorfR
142Command-Line Switch:	<B>-secondcolor</B>
143</pre>
144<UL>
145Fill color for the second hand, in any of the forms acceptable to <B>Tk_GetColor</B>.
146The default is "Black".
147</UL>
148<P>
149<pre>
150Name:                   <B>secondRadius</B>
151Class:                  <B>Radius</B>
152Command-Line Switch:	<B>-secondradius</B>
153</pre>
154<UL>
155Specifies the radius of the second hand as a percentage of the radius
156from the center to the out perimeter of the clock.
157The value must be a fraction &lt;= 1.  The default is ".9".
158</UL>
159<P>
160<pre>
161Name:                   <B>showAmPm</B>
162Class:                  <B>ShosAmPm</B>
163Command-Line Switch:	<B>-showampm</B>
164</pre>
165<UL>
166Specifies whether the AM/PM radiobuttons should be displayed, in any
167of the forms acceptable to <B>Tcl_GetBoolean</B>.  The default is yes.
168</UL>
169<P>
170<pre>
171Name:                   <B>state</B>
172Class:                  <B>State</B>
173Command-Line Switch:	<B>-state</B>
174</pre>
175<UL>
176Specifies the editable state for the hands on the watch.  In a normal
177state, the user can select and move the hands via mouse button 1.  The 
178valid values are <B>normal</B>, and <B>disabled</B>.  The defult is normal.
179</UL>
180<P>
181<pre>
182Name:                   <B>tickColor</B>
183Class:                  <B>ColorfR
184Command-Line Switch:	<B>-tickcolor</B>
185</pre>
186<UL>
187Fill color for the 60 ticks around the perimeter of the watch,
188in any of the forms acceptable to <B>Tk_GetColor</B>.  The default is "Black".
189</UL>
190<P>
191<pre>
192Name:                   <B>width</B>
193Class:                  <B>Width</B>
194Command-Line Switch:	<B>-width</B>
195</pre>
196<UL>
197Specifies the width of the watch widget in any of the forms 
198acceptable to <B>Tk_GetPixels</B>.  The default height is 155 pixels.
199</UL>
200</pre><HR>
201
202</pre><H2>DESCRIPTION</H2>
203<P>
204
205The <B>watch</B> command creates a watch with hour, minute, and
206second hands modifying the time value.
207
208</pre><H2>METHODS</H2>
209<P>
210The <B>watch</B> command creates a new Tcl command whose
211name is <I>pathName</I>. This command may be used to invoke various
212operations on the widget. It has the following general form:
213<pre>
214<I>pathName option </I>?<I>arg arg ...</I>?
215</pre>
216<I>Option</I> and the <I>arg</I>s
217determine the exact behavior of the command. The following
218commands are possible for watch widgets:
219
220</pre><H2>WIDGET-SPECIFIC METHODS</H2>
221<DL>
222<DT> <I>pathName <B>cget</B> <I>option</I>
223</I></B>
224<DD> Returns the current value of the configuration option given
225by <I>option</I>.
226<I>Option</I> may have any of the values accepted by the <B>watch</B>
227command.
228</DL>
229<DL>
230<DT> <I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>?
231</I></B>
232<DD> Query or modify the configuration options of the widget.
233If no <I>option</I> is specified, returns a list describing all of
234the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for
235information on the format of this list).  If <I>option</I> is specified
236with no <I>value</I>, then the command returns a list describing the
237one named option (this list will be identical to the corresponding
238sublist of the value returned if no <I>option</I> is specified).  If
239one or more <I>option-value</I> pairs are specified, then the command
240modifies the given widget option(s) to have the given value(s);  in
241this case the command returns an empty string.
242<I>Option</I> may have any of the values accepted by the <B>watch</B>
243command.
244</DL>
245<DL>
246<DT> <I>pathName <B>get</B> ?<B>format</B>?
247</I></B>
248<DD> Returns the current time of the watch in a format of 
249string or as an integer clock value using the <B>-string</B> and <B>-clicks</B>
250format options respectively.  The default is by string.  Reference the 
251clock command for more information on obtaining time and its 
252formats.
253</DL>
254<DL>
255<DT> <I>pathName <B>show</B> <I>time</I>
256</I></B>
257<DD> Changes the currently displayed time to be that of the time 
258argument.  The time may be specified either as a string, an
259integer clock value or the keyword "now".  Reference the clock 
260command for more information on obtaining time and its format.
261</DL>
262<DL>
263<DT> <I>pathName <B>watch</B> ?<B>args</B>?
264</I></B>
265<DD> Evaluates the specifieds <B>args</B> against the canvas component.
266
267</DL>
268</pre><H2>COMPONENTS</H2>
269<P>
270<pre>
271Name:                   <B>canvas</B>
272Class:                  <B>Canvas</B>
273</pre>
274<UL>
275The canvas component is the where the clock is drawn.  See the 
276Canvas widget manual entry for details.
277</UL>
278<P>
279<pre>
280Name:                   <B>frame</B>
281Class:                  <B>Frame</B>
282</pre>
283<UL>
284The frame component is the where the "AM" and "PM" radiobuttons are displayed.
285See the Frame widget manual entry for details.
286</UL>
287<P>
288<pre>
289Name:                   <B>am</B>
290Class:                  <B>Radiobutton</B>
291</pre>
292<UL>
293The am component indicates whether on not the time is relative to "AM".
294See the Radiobutton widget manual entry for details.
295</UL>
296<P>
297<pre>
298Name:                   <B>pm</B>
299Class:                  <B>Radiobutton</B>
300</pre>
301<UL>
302The pm component indicates whether on not the time is relative to "PM".
303See the Radiobutton widget manual entry for details.
304</UL>
305</table>
306
307</pre><H2>EXAMPLE</H2>
308<pre>
309watch .w -state disabled -showampm no -width 155 -height 155
310pack .w -padx 10 -pady 10 -fill both -expand yes
311
312while {1} {
313  after 1000
314  .w show
315  update
316}
317</pre>
318</pre><H2>AUTHORS</H2>
319John Tucker
320<P>
321Mark L. Ulferts
322</pre><H2>KEYWORDS</H2>
323watch, hand, ticks, pivot, widget
324
325