logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

iwidgets::watch - Create and manipulate time with a watch widgets

Associated Options

       See the "Canvas" manual entry for details on the above associated options.

Author

       John Tucker Mark L. Ulferts

Components

       Name:           canvas
       Class:          Canvas

              The  canvas  component  is  the  where the clock is drawn.  See the Canvas widget manual entry for
              details.

       Name:           frame
       Class:          Frame

              The frame component is the where the "AM" and "PM" radiobuttons  are  displayed.   See  the  Frame
              widget manual entry for details.

       Name:           am
       Class:          Radiobutton

              The  am  component  indicates  whether  on  not the time is relative to "AM".  See the Radiobutton
              widget manual entry for details.

       Name:           pm
       Class:          Radiobutton

              The pm component indicates whether on not the time is  relative  to  "PM".   See  the  Radiobutton
              widget manual entry for details.

Description

       The iwidgets::watch command creates a watch with hour, minute, and second hands modifying the time value.

Example

       package  require Iwidgets 4.0 iwidgets::watch .w -state disabled -showampm no -width 155 -height 155 pack
       .w -padx 10 -pady 10 -fill both -expand yes

       while {1} {
         after 1000
         .w show
         update }

Inheritance

       itk::Widget <- iwidgets::Watch

Keywords

       watch, hand, ticks, pivot, widget

Tk                                                                                            iwidgets::watch(1)

Methods

       The iwidgets::watch command creates a new Tcl command whose name is pathName. This command may be used to
       invoke various operations on the widget. It has the following general form: pathNameoption ?argarg...?
       Option  and the args determine the exact behavior of the command. The following commands are possible for
       watch widgets:

Name

       iwidgets::watch - Create and manipulate time with a watch widgets

Standard Options

backgroundcursorforegroundrelief

       See the "options" manual entry for details on the standard options.

Synopsis

iwidgets::watchpathName ?options?

Widget-Specific Methods

pathNamecgetoption
              Returns the current value of the configuration option given by option.  Option may have any of the
              values accepted by the iwidgets::watch command.

       pathNameconfigure ?option? ?valueoptionvalue...?
              Query or modify the configuration options of the widget.  If no option  is  specified,  returns  a
              list describing all of the available options for pathName (see Tk_ConfigureInfo for information on
              the  format  of this list).  If option is specified with no value, then the command returns a list
              describing the one named option (this list will be identical to the corresponding sublist  of  the
              value  returned if no option is specified).  If one or more option-value pairs are specified, then
              the command modifies the given widget option(s) to have the given  value(s);   in  this  case  the
              command   returns  an  empty  string.   Option  may  have  any  of  the  values  accepted  by  the
              iwidgets::watch command.

       pathNameget ?format?
              Returns the current time of the watch in a format of string or as an integer clock value using the
              -string and -clicks format options respectively.  The default is by string.  Reference  the  clock
              command for more information on obtaining time and its formats.

       pathNameshowtime
              Changes  the  currently displayed time to be that of the time argument.  The time may be specified
              either as a string, an integer clock value or the keyword "now".  Reference the clock command  for
              more information on obtaining time and its format.

       pathNamewatch ?args?
              Evaluates the specifieds args against the canvas component.

Widget-Specific Options

       Name:           clockColor
       Class:          ColorfRCommand-LineSwitch:-clockcolor

              Fill  color  for  the  main  oval  encapsulating  the  watch,  in  any  of the forms acceptable to
              Tk_GetColor.  The default is "White".

       Name:           clockStipple
       Class:          BitmapfRCommand-LineSwitch:-clockstipple

              Bitmap for the main oval encapsulating the watch, in any of the forms acceptable to  Tk_GetBitmap.
              The default is "".

       Name:           height
       Class:          Height
       Command-Line Switch:           -height

              Specifies  the  height  of  the  watch widget in any of the forms acceptable to Tk_GetPixels.  The
              default height is 175 pixels.

       Name:           hourColor
       Class:          ColorfRCommand-LineSwitch:-hourcolor

              Fill color for the hour hand, in any of the forms  acceptable  to  Tk_GetColor.   The  default  is
              "Red".

       Name:           hourRadius
       Class:          Radius
       Command-Line Switch:           -hourradius

              Specifies  the  radius  of  the hour hand as a percentage of the radius from the center to the out
              perimeter of the clock.  The value must be a fraction <= 1.  The default is ".5".

       Name:           minuteColor
       Class:          ColorfRCommand-LineSwitch:-minutecolor

              Fill color for the minute hand, in any of the forms acceptable to  Tk_GetColor.   The  default  is
              "Yellow".

       Name:           minuteRadius
       Class:          Radius
       Command-Line Switch:           -minuteradius

              Specifies  the  radius of the minute hand as a percentage of the radius from the center to the out
              perimeter of the clock.  The value must be a fraction <= 1.  The default is ".8".

       Name:           pivotColor
       Class:          ColorfRCommand-LineSwitch:-pivotcolor

              Fill color for the circle in which the watch hands rotate  in  any  of  the  forms  acceptable  to
              Tk_GetColor.  The default is "White".

       Name:           pivotRadius
       Class:          Radius
       Command-Line Switch:           -pivotradius

              Specifies  the radius of the circle in which the watch hands rotate as a percentage of the radius.
              The value must be a fraction <= 1.  The default is ".1".

       Name:           secondColor
       Class:          ColorfRCommand-LineSwitch:-secondcolor

              Fill color for the second hand, in any of the forms acceptable to  Tk_GetColor.   The  default  is
              "Black".

       Name:           secondRadius
       Class:          Radius
       Command-Line Switch:           -secondradius

              Specifies  the  radius of the second hand as a percentage of the radius from the center to the out
              perimeter of the clock.  The value must be a fraction <= 1.  The default is ".9".

       Name:           showAmPm
       Class:          ShosAmPm
       Command-Line Switch:           -showampm

              Specifies whether the AM/PM radiobuttons should be displayed, in any of the  forms  acceptable  to
              Tcl_GetBoolean.  The default is yes.

       Name:           state
       Class:          State
       Command-Line Switch:           -state

              Specifies  the  editable state for the hands on the watch.  In a normal state, the user can select
              and move the hands via mouse button 1.  The valid values are normal, and disabled.  The defult  is
              normal.

       Name:           tickColor
       Class:          ColorfRCommand-LineSwitch:-tickcolor

              Fill  color  for the 60 ticks around the perimeter of the watch, in any of the forms acceptable to
              Tk_GetColor.  The default is "Black".

       Name:           width
       Class:          Width
       Command-Line Switch:           -width

              Specifies the width of the watch widget in any of  the  forms  acceptable  to  Tk_GetPixels.   The
              default height is 155 pixels.
________________________________________________________________________________________________________________

See Also