iwidgets::datefield(1)
π NAME π
okay so, bestie, meet iwidgets::datefield β the command that creates and manipulates a date field widget. that's it, that's the whole vibe. a whole little widget whose entire personality is dates. ποΈβ¨
πΈ SYNOPSIS πΈ
iwidgets::datefield pathName ?options?
short. sweet. iconic. π«Ά
π¦ INHERITANCE π¦
the family tree, no cap β this widget got its genes from up the chain:
itk::Widget <- iwidgets::LabeledWidget <- iwidgets::Datefield
so it's an itk::Widget, which begat iwidgets::LabeledWidget, which begat iwidgets::Datefield. generational slay. π
β¨ STANDARD OPTIONS β¨
these are the basics, the everyday fits it can wear:
backgroundborderWidthcursorexportSelectionforegroundhighlightColorhighlightThicknessinsertBackgroundjustifyrelief
see the "options" manual entry for the deets on all of the standard options, bestie β I'm not gonna retype the whole thing, that's their job. π
π INHERITED OPTIONS π
these came from the family (specifically labeledwidget), and they're giving very "I got it from my mama":
disabledForegroundlabelBitmaplabelFontlabelImagelabelMarginlabelPoslabelTextlabelVariablestatesticky
okay so labelFontlabelImage is written exactly how the original page prints it. I am not touching it. we do not edit the ancestors. π see the "labeledwidget" class manual entry for the details on these inherited options.
π WIDGET-SPECIFIC OPTIONS π
now THIS is the main character section. the options that are hers and hers alone. π
-childsiteposβ Name:childSitePos, Class:Position. tells you where the child site sits inside the date field:n,s,e, orw. the default ise. π§-commandβ Name:command, Class:Command. a Tcl command to be executed the moment a Return key press event gets detected. hit enter, stuff happens. β¨-gmtβ Name:gmt, Class:GMT. decides whether the date is calculated relative to Greenwich Mean Time. takes a boolean value. the default isno. π-intβ Name:int, Class:DateFormat. this one's for international date formats, and it must be a boolean value.- when it's true, the date is formatted as
YYYY-MM-DD - when it's false, it's formatted as
MM/DD/YYYY
- when it's true, the date is formatted as
heads up: this format is driven by theclock scancommand, andYYYY-MM-DDis only supported in Tk 8.4 or later. the default isno.
-iqβ Name:iq, Class:Iq. the big brain option π§ β it sets the level of intelligence shown in the actions the datefield takes while processing keypress events. valid settings arehigh,average, andlow.- with high iq, the date prevents the user from typing in an invalid date. for example, if the current date is
05/31/1997and the user changes the month to04, then the day gets instantly modified for them to be30. also, leap years are fully taken into account. queen behavior. - with average iq, the month is limited to the values of
01-12, but it is possible to type in an invalid day. - a setting of low iq tells the widget to do no validity checking at all during date entry.
- with both
averageandlowiq levels, it's assumed the validity will be determined at a later time using the date'sisvalidcommand.
- with high iq, the date prevents the user from typing in an invalid date. for example, if the current date is
-stateβ Name:state, Class:State. two states for the datefield:normalordisabled. if the datefield is disabled, input is not accepted. the default isnormal. π΄-textbackgroundβ Name:textBackground, Class:Background. background color for the inside textual portion of the entry field. the value may be given in any of the forms acceptable toTk_GetColor. π¨-textfontβ Name:textFont, Class:Font. name of the font used to display text in the datefield. the value may be given in any of the forms acceptable toTk_GetFont. βοΈ
π DESCRIPTION π
the iwidgets::datefield command creates an enhanced text entry widget made for the purpose of date entry, with various degrees of built-in intelligence. it's an entry field that actually knows things. π§ββοΈ
π§ METHODS π§
the iwidgets::datefield command creates a brand new Tcl command whose name is pathName. you use that command to invoke various operations on the widget, and the general form goes like this:
pathName option ?arg arg ...?
the option and the args decide the exact behavior of the command. for datefield widgets, the following commands are possible:
π WIDGET-SPECIFIC METHODS π
pathName cget optionβ returns the current value of the configuration option given byoption.optionmay have any of the values accepted by theiwidgets::datefieldcommand.pathName configure ?option? ?value option value ...?β query or modify the configuration options of the widget.- if no
optionis specified, it returns a list describing all the available options forpathName(seeTk_ConfigureInfofor info on the format of this list). - if
optionis specified with novalue, 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 nooptionis specified). - if one or more
option-valuepairs are specified, then the command modifies the given widget option(s) to have the given value(s); in that case the command returns an empty string. optionmay have any of the values accepted by theiwidgets::datefieldcommand.
- if no
pathName get ?format?β returns the current contents of the datefield, formatted as a string or as an integer clock value using the-stringand-clicksformat options respectively. the default is by string. π reference theclockcommand for more info on obtaining dates and their formats.pathName isvalidβ returns a boolean indication of the validity of the currently displayed date value. for example,03/03/1960is valid whereas02/29/1997is invalid. β βpathName show dateβ changes the currently displayed date to be that of thedateargument. the date may be specified either as a string, an integer clock value, or the keyword"now". π reference theclockcommand for more info on obtaining dates and their formats.
π COMPONENTS π
- Name:
date, Class:Entry. the date component provides the entry field for date input and display. see the "entry" widget manual entry for the details on the date component item. π«Ά
π EXAMPLE π
here's the whole thing in action, copy-paste ready, no cap:
package require Iwidgets 4.0
proc returnCmd {} {
puts [.df get]
}
iwidgets::datefield .df -command returnCmd
pack .df -fill x -expand yes -padx 10 -pady 10
hit return β it prints what's in the field. obsessed. ππ
π AUTHOR π
Mark L. Ulferts β the legend, the icon, the moment. π
β KEYWORDS β
datefield, widget
and that's the whole page, bestie! this manual page comes to you from the Tk corner of the universe and it's filed under iwidgets::datefield(1) β section 1, exactly where it belongs. go forth and enter dates intelligently. π¦π
β¨
π¦ where this page comes from
- debian bookworm: iwidgets4-doc 4.1.1-2.1
- debian trixie: iwidgets4-doc 4.1.1-4
- ubuntu jammy: iwidgets4-doc 4.1.1-2.1
- ubuntu noble: iwidgets4-doc 4.1.1-2.1
- ubuntu resolute: iwidgets4-doc 4.1.1-4
- ubuntu stonking: iwidgets4-doc 4.1.1-4
- Copyright (c) 1997 DSC Technologies Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms