1iwidgets::watch − Create and manipulate time with a watch widgets

iwidgets::watch pathName ?options? itk::Widget <‐ iwid‐

3gets::Watch
4

background cursor foreground relief

6See  the  "options"  manual entry for details on the standard op‐
7tions.  See the "Canvas" manual entry for details  on  the  above
8associated options.
9
10Name:           clockColor
11Class:          ColorfR

Command‐Line Switch: ‐clockcolor

13Fill  color  for the main oval encapsulating the watch, in any of
14the forms acceptable to Tk_GetColor.  The default is "White".
15Name:           clockStipple
16Class:          BitmapfR

Command‐Line Switch: ‐clockstipple

18Bitmap for the main oval encapsulating the watch, in any  of  the
19forms acceptable to Tk_GetBitmap.  The default is "".
20Name:           height
21Class:          Height
22Command‐Line Switch:           ‐height
23Specifies  the height of the watch widget in any of the forms ac‐
24ceptable to Tk_GetPixels.  The default height is 175 pixels.
25Name:           hourColor
26Class:          ColorfR

Command‐Line Switch: ‐hourcolor

28Fill color for the hour hand, in any of the forms  acceptable  to

Tk_GetColor. The default is "Red".

30Name:           hourRadius
31Class:          Radius
32Command‐Line Switch:           ‐hourradius
33Specifies  the radius of the hour hand as a percentage of the ra‐
34dius from the center to the out perimeter of the clock.  The val‐
35ue must be a fraction <= 1.  The default is ".5".
36Name:           minuteColor
37Class:          ColorfR

Command‐Line Switch: ‐minutecolor

39Fill color for the minute hand, in any of the forms acceptable to

Tk_GetColor. The default is "Yellow".

41Name:           minuteRadius
42Class:          Radius
43Command‐Line Switch:           ‐minuteradius
44Specifies the radius of the minute hand as a  percentage  of  the
45radius  from  the  center to the out perimeter of the clock.  The
46value must be a fraction <= 1.  The default is ".8".
47Name:           pivotColor
48Class:          ColorfR

Command‐Line Switch: ‐pivotcolor

50Fill color for the circle in which the watch hands rotate in  any
51of the forms acceptable to Tk_GetColor.  The default is "White".
52Name:           pivotRadius
53Class:          Radius
54Command‐Line Switch:           ‐pivotradius
55Specifies  the  radius of the circle in which the watch hands ro‐
56tate as a percentage of the radius.  The value must be a fraction
57<= 1.  The default is ".1".
58Name:           secondColor
59Class:          ColorfR

Command‐Line Switch: ‐secondcolor

61Fill color for the second hand, in any of the forms acceptable to

Tk_GetColor. The default is "Black".

63Name:           secondRadius
64Class:          Radius
65Command‐Line Switch:           ‐secondradius
66Specifies the radius of the second hand as a  percentage  of  the
67radius  from  the  center to the out perimeter of the clock.  The
68value must be a fraction <= 1.  The default is ".9".
69Name:           showAmPm
70Class:          ShosAmPm
71Command‐Line Switch:           ‐showampm
72Specifies whether the AM/PM radiobuttons should be displayed,  in
73any  of  the  forms acceptable to Tcl_GetBoolean.  The default is
74yes.
75Name:           state
76Class:          State
77Command‐Line Switch:           ‐state
78Specifies the editable state for the hands on the  watch.   In  a
79normal  state,  the  user can select and move the hands via mouse
80button 1.  The valid values are normal, and disabled.  The defult
81is normal.
82Name:           tickColor
83Class:          ColorfR

Command‐Line Switch: ‐tickcolor

85Fill color for the 60 ticks around the perimeter of the watch, in
86any of the forms  acceptable  to  Tk_GetColor.   The  default  is
87"Black".
88Name:           width
89Class:          Width
90Command‐Line Switch:           ‐width
91Specifies  the  width of the watch widget in any of the forms ac‐
92ceptable to Tk_GetPixels.  The default height is 155 pixels.
93
94
95The iwidgets::watch command creates a watch  with  hour,  minute,
96and second hands modifying the time value.
97
98The  iwidgets::watch command creates a new Tcl command whose name
99is pathName. This command may be used to  invoke  various  opera‐
100tions  on the widget. It has the following general form: pathName

option ?arg arg ...? Option and the args determine the exact be‐

102havior  of  the  command. The following commands are possible for
103watch widgets:
104

pathName cget option Returns the current value of the configura‐

106tion  option  given by option.  Option may have any of the values
107accepted by the iwidgets::watch command.  pathName configure ?op‐

tion? ?value option value ...? Query or modify the configuration

109options of the widget.  If no option is specified, returns a list
110describing all of the available options for pathName (see Tk_Con‐

figureInfo for information on the format of this list). If op‐

tion is specified with no value, then the command returns a list

113describing the one named option (this list will be  identical  to
114the  corresponding  sublist of the value returned if no option is
115specified).  If one or more  option−value  pairs  are  specified,
116then  the command modifies the given widget option(s) to have the
117given value(s);  in  this  case  the  command  returns  an  empty
118string.   Option may have any of the values accepted by the iwid‐

gets::watch command. pathName get ?format? Returns the current

120time  of  the  watch in a format of string or as an integer clock
121value using the ‐string and ‐clicks format options  respectively.
122The  default  is by string.  Reference the clock command for more
123information on obtaining time and  its  formats.   pathName  show

time Changes the currently displayed time to be that of the time

125argument.  The time may be specified either as a string, an inte‐
126ger  clock  value or the keyword "now".  Reference the clock com‐
127mand for more information  on  obtaining  time  and  its  format.

pathName watch ?args? Evaluates the specifieds args against the

129canvas component.
130
131Name:           canvas
132Class:          Canvas
133The canvas component is the where the clock is  drawn.   See  the
134Canvas widget manual entry for details.
135Name:           frame
136Class:          Frame
137The  frame  component is the where the "AM" and "PM" radiobuttons
138are displayed.  See the Frame widget manual entry for details.
139Name:           am
140Class:          Radiobutton
141The am component indicates whether on not the time is relative to
142"AM".  See the Radiobutton widget manual entry for details.
143Name:           pm
144Class:          Radiobutton
145The pm component indicates whether on not the time is relative to
146"PM".  See the Radiobutton widget manual entry for details.
147
148package require Iwidgets 4.0 iwidgets::watch .w  ‐state  disabled
149‐showampm  no  ‐width  155  ‐height 155 pack .w ‐padx 10 ‐pady 10
150‐fill both ‐expand yes
151
152while {1} {
153  after 1000
154  .w show
155  update } John Tucker Mark L. Ulferts watch, hand, ticks, pivot,
156widget
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
Impressum