1iwidgets::calendar  −  Create  and  manipulate a monthly calendar

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

3gets::calendar

background cursor foreground

5See  the  "options"  manual entry for details on the standard op‐
6tions.

int

8See the "datefield" manual entry  for  details  on  this  option.
9Note that this option is needed when the calendar is used in con‐
10junction with the dateentry widget.  It is necessary for  support
11of international date formats in versions of Tk < 8.4.
12Name:           backwardImage
13Class:          Image
14Command‐Line Switch:           ‐backwardimage
15Specifies  a image to be displayed on the backwards calendar but‐
16ton.  This image must have been created previously with the image

create command. If none is specified, a default is provided.

18Name:           buttonForeground
19Class:          Foreground
20Command‐Line Switch:           ‐buttonforeground
21Specifies  the  foreground color of the forward and backward but‐
22tons in any of the forms acceptable to Tk_GetColor.  The  default
23color is blue.
24Name:           command
25Class:          Command
26Command‐Line Switch:           ‐command
27Specifies  a  Tcl  script to executed upon selection of a date in
28the calendar.  If the command script contains any  %  characters,
29then  the  script  will not be executed directly.  Instead, a new
30script will be generated by replacing each %, and  the  character
31following  it,  with information from the calendar.  The replace‐
32ment depends on the character following the %, as defined in  the
33list  below.   %d  Replaced  with the date selected in the format
34mm/dd/yyyy.
35Name:           currentDateFont
36Class:          Font
37Command‐Line Switch:           ‐currentdatefont
38Specifies the font used for the current date text in any  of  the
39forms acceptable to Tk_GetFont.
40Name:           dateFont
41Class:          Font
42Command‐Line Switch:           ‐datefont
43Specifies  the font used for the days of the month text in any of
44the forms acceptable to Tk_GetFont.
45Name:           dayFont
46Class:          Font
47Command‐Line Switch:           ‐dayfont
48Specifies the font used for the days of the week text in  any  of
49the forms acceptable to Tk_GetFont.
50Name:           days
51Class:          days
52Command‐Line Switch:           ‐days
53Specifies  a  list  of values to be used for the days of the week
54text to displayed above the days of the month.  The default value
55is {Su Mo Tu We Th Fr Sa}.
56Name:           forewardImage
57Class:          Image
58Command‐Line Switch:           ‐forewardimage
59Specifies  a image to be displayed on the forewards calendar but‐
60ton.  This image must have been created previously with the image

create command. If none is specified, a default is provided.

62Name:           height
63Class:          Height
64Command‐Line Switch:           ‐height
65Specifies a desired window height that the calendar widget should
66request from its geometry manager.  The value may be specified in
67any  of the forms acceptable to Tk_GetPixels.  The default height
68is 165 pixels.
69Name:           outline
70Class:          Outline
71Command‐Line Switch:           ‐outline
72Specifies the outline color used to  surround  the  days  of  the
73month  text  in  any of the forms acceptable to Tk_GetColor.  The
74default is the same color as the background.
75Name:           selectColor
76Class:          Foreground
77Command‐Line Switch:           ‐selectcolor
78Specifies the color of the ring displayed that distinguishes  the
79currently selected date in any of the forms acceptable to Tk_Get‐

Color. The default is red.

81Name:           selectThickness
82Class:          SelectThickness
83Command‐Line Switch:           ‐selectthickness
84Specifies the thickness of the ring displayed that  distinguishes
85the currently selected date.  The default is 3 pixels.
86Name:           startday
87Class:          Day
88Command‐Line Switch:           ‐startday
89Specifies the starting day for the week: sunday, monday, tuesday,

wednesday, thursday, friday, or saturday. The default is sunday.

91Name:           titleFont
92Class:          Font
93Command‐Line Switch:           ‐titlefont
94Specifies the font used for the title text which consists of  the
95month  and  year.   The font may be given in any of the forms ac‐
96ceptable to Tk_GetFont.
97Name:           weekdayBackground
98Class:          Background
99Command‐Line Switch:           ‐weekdaybackground
100Specifies the background color for the weekdays which  allows  it
101to  be visually distinguished from the weekend.  The color may be
102given in any of the forms acceptable to Tk_GetColor.  The default
103is the same as the background.
104Name:           weekendBackground
105Class:          Background
106Command‐Line Switch:           ‐weekendbackground
107Specifies  the  background color for the weekends which allows it
108to be visually distinguished from the weekdays.  The color may be
109given in any of the forms acceptable to Tk_GetColor.  The default
110is the same as the background.
111Name:           width
112Class:          Width
113Command‐Line Switch:           ‐width
114Specifies a desired window width that the calendar widget  should
115request from its geometry manager.  The value may be specified in
116any of the forms acceptable to Tk_GetPixels.  The  default  width
117is 200 pixels.
118
119The  iwidgets::calendar command creates a calendar widget for the
120selection of a date, displaying a single month at a  time.   But‐
121tons  exist  on the top to change the month in effect turning the
122pages of a calendar.  As a page is  turned,  the  dates  for  the
123month  are  modified.   Selection  of  a date visually marks that
124date.  The selected value can be monitored via the  ‐command  op‐
125tion or just retrieved using the get command.
126
127The  iwidgets::calendar  command  creates a new Tcl command whose
128name is pathName.  This command may be used to invoke various op‐
129erations on the widget.  It has the following general form: path‐

Name option ?arg arg ...? Option and the args determine the ex‐

131act behavior of the command.  The following commands are possible
132for calendar widgets:
133

pathName cget option Returns the current value of the configura‐

135tion  option  given by option.  Option may have any of the values
136accepted by the iwidgets::calendar command.   pathName  configure
137?option? ?value option value ...?  Query or modify the configura‐
138tion options of the widget.  If no option is specified, returns a
139list  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

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

gets::calendar command. pathName get ?format? Returns the cur‐

149rently selected date in a format of string or as an integer clock
150value using the ‐string and ‐clicks format options  respectively.
151The  default  is by string.  Reference the clock command for more
152information on obtaining dates and their formats.   pathName  se‐

lect date Changes the currently selected date to the value speci‐

154fied which must be in the form of a date string, an integer clock
155value  or  as the keyword "now".  Reference the clock command for
156more information on obtaining dates and their formats.  Note that
157selecting a date does not change the month being shown to that of
158the date given.  This chore is left to the show  command.   path‐

Name show date Changes the currently displayed date to be that of

160the date argument which must be in the form of a date string,  an
161integer clock value or as the keyword "now".  Reference the clock
162command for more information on obtaining dates  and  their  for‐
163mats.
164
165Name:           forward
166Class:          Button
167The  forward  component provides the button on the upper right of
168the calendar that changes the month to  be  the  next.   See  the
169"button" widget manual entry for details on the forward component
170item.
171Name:           page
172Class:          Canvas
173The page component provides the canvas on which the  title,  days
174of the week, and days of the month appear.  See the "canvas" wid‐
175get manual entry for details on the page component item.
176Name:           backward
177Class:          Button
178The backward component provides the button on the upper right  of
179the  calendar  that  changes  the  month to be the next.  See the
180"button" widget manual entry for details on the  backward  compo‐
181nent item.
182
183 package require Iwidgets 4.0
184 proc selectCmd {date} {
185   puts $date
186 }
187
188 iwidgets::calendar     .c     ‐command    {selectCmd    %d}    \
189                ‐weekendbackground          mistyrose           \
190                ‐weekdaybackground  ghostwhite  ‐outline  black \
191                ‐startday wednesday ‐days {We Th Fr Sa Su Mo Tu}
192 pack .c Mark L. Ulferts Michael J. McLennan calendar, widget
193
194
195
196
197
198
Impressum