mentry::dateMentry
Command
mentry::timeMentry
Command
mentry::putClockVal
Command
mentry::getClockVal
Command
mentry::dateMentry
Commandmentry::dateMentry
- Create and manipulate mentry widgets
for date
mentry::dateMentry pathName format separator ?options?
pathName
for displaying and editing a date according to the
format
argument, which must be a string of length
3, consisting of the letters "d"
for the day
(01
- 31
), "m"
for the
month (01
- 12
), and "y"
or "Y"
for the year without century
(00
- 99
) or with century (e.g.,
2003
), in an arbitrary order. These field descriptor
characters have the same meanings as in the clock
format
command. The
separator
argument specifies the text to be
displayed in the labels separating the three entry children of the
mentry widget (the most common values are the "/"
,
"-"
, and "."
characters).
The supported options
are the same as in the case
of the mentry::mentry
command.
type
attribute of the widget
to the value "Date"
, saves the value of
format
in its format
attribute,
and returns the name of the newly created widget.
mentry::dateMentry
command defines four new
bindings for the entry children of the mentry widget it creates:
The Up
key increments the entry's value by 1 if the latter
is less than the allowed maximum for that child. Similarly, the
Down
key decrements the entry's value by 1 if the latter
is greater than the allowed minimum for that child. The
Prior
key increments the entry's value by at most 10 if
the latter is less than the allowed maximum for that child.
Similarly, the Next
key decrements the entry's value by at
most 10 if the latter is greater than the allowed minimum for that
child. If the entry is empty then all of these keys insert the
child-specific minimum value into the entry.
mentry::timeMentry
Commandmentry::timeMentry
- Create and manipulate mentry widgets
for time
mentry::timeMentry pathName format separator ?options?
pathName
for displaying and editing a time according to the
format
argument, which must be a string of length
2 or 3, consisting of the following field descriptor characters of
the clock format
command:
"H"
or "I"
, followed by
"M"
, and optionally the letter
"S"
. An "H"
as first
character specifies the time format "%H:%M"
or
"%H:%M:%S"
(i.e., with the hour between
0
and 23
), while the letter
"I"
stands for "%I:%M
%p"
or "%I:%M:%S %p"
(i.e., with AM/PM indicator). The separator
argument specifies the text to be displayed in the labels separating
the entry children of the mentry widget. (this is usually the
":"
character). The
options
are the same as in the case of the
mentry::mentry
command.
type
attribute of the widget
to the value "Time"
, saves the value of
format
in its format
attribute,
and returns the name of the newly created widget.
mentry::timeMentry
command defines four new
bindings for the entry children of the mentry widget it creates:
The Up
key increments the entry's value by 1 if the latter
is less than the allowed maximum for that child. Similarly, the
Down
key decrements the entry's value by 1 if the latter
is greater than the allowed minimum for that child. The
Prior
key increments the entry's value by at most 10 if
the latter is less than the allowed maximum for that child.
Similarly, the Next
key decrements the entry's value by at
most 10 if the latter is greater than the allowed minimum for that
child. If the entry is empty then all of these keys insert the
child-specific minimum value into the entry.
mentry::putClockVal
Commandmentry::putClockVal
- Output a clock value to a date or
time mentry
mentry::putClockVal clockValue pathName ?-gmt boolean?
clockValue
to the mentry widget
pathName
, which must have been created with the
mentry::dateMentry
or
mentry::timeMentry
command (this is checked by examining the widget's
type
attribute, which must have the value
"Date"
or "Time"
).
clock format
command, the optional argument pair -gmt
boolean
specifies whether the clock value is to be
formatted as Greenwich Mean Time or according to the local timezone as
defined by the operating environment.
mentry::getClockVal
Commandmentry::getClockVal
- Get the clock value from a date or
time mentry
mentry::getClockVal pathName ?-base clockValue? ?-gmt boolean?
pathName
, which must
have been created with the mentry::dateMentry
or mentry::timeMentry
command (this is
checked by examining the widget's type
attribute,
which must have the value "Date"
or "Time"
).
clock scan
command, the optional argument pair -base
clockValue
specifies that the date contained in
clockValue
is to be used when getting the clock
value from the given mentry widget, and the optional argument
pair -gmt boolean
specifies whether
the clock value is to be calculated relative to Greenwich Mean Time or
according to the local timezone as defined by the operating
environment.
Return value | Meaning |
---|---|
"EMPTY" |
Any entry child (except the one containing the seconds) is empty. |
"BAD" |
The value of the day, month, or hour (the latter only if the
AM/PM indicator is present) is 0 . |
"BAD_DATE" |
The <year, month, day> triple is invalid (note that the command is aware of leap years). |
"BAD_YEAR" |
The above triple is valid, but the conversion (made with the
aid of the clock scan command)
failed because of an unsupported year value (e.g., between
38 and 70 ). |