calendar - Create and manipulate a monthly calendar

SYNOPSIS

calendar pathName ?options?

INHERITANCE

itk::Widget <- calendar

STANDARD OPTIONS

background
cursor
foreground

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

ASSOCIATED OPTIONS

int

See the "datefield" manual entry for details on this option. Note that this option is needed when the calendar is used in conjunction with the dateentry widget. It is necessary for support of international date formats in versions of Tk less than 8.4.

WIDGET-SPECIFIC OPTIONS

Name:                   backwardImage
Class:                  Image
Command-Line Switch:	-backwardimage

Name:                   buttonForeground
Class:                  Foreground
Command-Line Switch:	-buttonforeground

Name:                   command
Class:                  Command
Command-Line Switch:	-command
%d
Replaced with the date selected in the format mm/dd/yyyy.

Name:                   currentDateFont
Class:                  Font
Command-Line Switch:	-currentdatefont

Name:                   dateFont
Class:                  Font
Command-Line Switch:	-datefont

Name:                   dayFont
Class:                  Font
Command-Line Switch:	-dayfont

Name:                   days
Class:                  days
Command-Line Switch:	-days

Name:                   forewardImage
Class:                  Image
Command-Line Switch:	-forewardimage

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

Name:                   outline
Class:                  Outline
Command-Line Switch:	-outline

Name:                   selectColor
Class:                  Foreground
Command-Line Switch:	-selectcolor

Name:                   selectThickness
Class:                  SelectThickness
Command-Line Switch:	-selectthickness

Name:                   startday
Class:                  Day
Command-Line Switch:	-startday

Name:                   titleFont
Class:                  Font
Command-Line Switch:	-titlefont

Name:                   weekdayBackground
Class:                  Background
Command-Line Switch:	-weekdaybackground

Name:                   weekendBackground
Class:                  Background
Command-Line Switch:	-weekendbackground

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


DESCRIPTION

The calendar command creates a calendar widget for the selection of a date, displaying a single month at a time. Buttons exist on the top to change the month in effect turning the pages of a calendar. As a page is turned, the dates for the month are modified. Selection of a date visually marks that date. The selected value can be monitored via the -command option or just retrieved using the get command.

METHODS

The calendar 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:

pathName option ?arg arg ...?
Option and the args determine the exact behavior of the command. The following commands are possible for calendar widgets:

WIDGET-SPECIFIC METHODS

pathName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the calendar command.
pathName configure ?option? ?value option value ...?
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 calendar command.
pathName get ?format?
Returns the currently selected date 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 dates and their formats.
pathName select date
Changes the currently selected date to the value specified which must be in the form of a date string, an integer clock value or as the keyword "now". Reference the clock command for more information on obtaining dates and their formats. Note that selecting a date does not change the month being shown to that of the date given. This chore is left to the show\R command.
pathName show date
Changes the currently displayed date to be that of the date argument which must be in the form of a date string, an integer clock value or as the keyword "now". Reference the clock command for more information on obtaining dates and their formats.

COMPONENTS

Name:                   forward
Class:                  Button

Name:                   page
Class:                  Canvas

Name:                   backward
Class:                  Button

EXAMPLE

 proc selectCmd {date} {
   puts $date
 }

 calendar .c -command {selectCmd %d} -weekendbackground mistyrose \\
	-weekdaybackground ghostwhite -outline black \\
        -startday wednesday -days {We Th Fr Sa Su Mo Tu}
 pack .c 

AUTHORS

Mark L. Ulferts

Michael J. McLennan

KEYWORDS

calendar, widget