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:

  • background
  • borderWidth
  • cursor
  • exportSelection
  • foreground
  • highlightColor
  • highlightThickness
  • insertBackground
  • justify
  • relief
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":

  • disabledForeground
  • labelBitmap
  • labelFontlabelImage
  • labelMargin
  • labelPos
  • labelText
  • labelVariable
  • state
  • sticky
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, or w. the default is e. 🧭
  • -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 is no. 🌍
  • -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
heads up: this format is driven by the clock scan command, and YYYY-MM-DD is only supported in Tk 8.4 or later. the default is no.
  • -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 are high, average, and low.
    • with high iq, the date prevents the user from typing in an invalid date. for example, if the current date is 05/31/1997 and the user changes the month to 04, then the day gets instantly modified for them to be 30. 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 average and low iq levels, it's assumed the validity will be determined at a later time using the date's isvalid command.
  • -state β€” Name: state, Class: State. two states for the datefield: normal or disabled. if the datefield is disabled, input is not accepted. the default is normal. 😴
  • -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 to Tk_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 to Tk_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 by option. option may have any of the values accepted by the iwidgets::datefield command.
  • pathName configure ?option? ?value option value ...? β€” query or modify the configuration options of the widget.
    • if no option is specified, it returns a list describing all the available options for pathName (see Tk_ConfigureInfo for info 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 that case the command returns an empty string.
    • option may have any of the values accepted by the iwidgets::datefield command.
  • pathName get ?format? β€” returns the current contents of the datefield, formatted as a 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 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/1960 is valid whereas 02/29/1997 is invalid. βœ…βŒ
  • pathName show date β€” changes the currently displayed date to be that of the date argument. the date may be specified either as a string, an integer clock value, or the keyword "now". πŸ• reference the clock command 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