widget_dateentry(n)
π widget_dateentry(n) β the date picker megawidget bestie
so this page lives in the Various megawidgets section of the manual, and it's literally all about the date entry megawidget, aka widget_dateentry. come get your calendar popup π
β¨ SYNOPSIS β¨
okay so first things first, you gotta have the right packages loaded, no cap:
package require Tcl 8.4
package require Tk 8.4
package require widget ?3.0?
package require widget::dateentry ?0.96?
widget::dateentry pathname ?options?
those ?3.0? and ?0.96? bits are optional version constraints, iykyk π¦
πΈ DESCRIPTION πΈ
this package gives you a dateentry megawidget β and yes bestie, it's a snidget π
. it's built on top of an ttk::entry, which means every single widget command that ttk::entry has is also available on the dateentry. slay, inheritance!
the invocation is literally:
widget::dateentry pathname ?options?
give it a pathname and some ?options? and you're off π
π WIDGET OPTIONS π
here's the whole menu of flags, no skips, no cuts:
-commandβ a script that gets evaluated when a date was selected π₯-dateformatβ the format of the date that is returned. default is%m/%d/%Yβ-firstdayβ see the calendar man page π-fontβ picks the font used in the widget. it defaults toHelvetica 9β¨-highlightcolorβ see the calendar man page π-languageβ see the calendar man page π-shadecolorβ see the calendar man page π-showpastβ see the calendar man page π-textvariableβ names a variable whose value is linked to the entry widget's contents. whenever the variable changes value, the widget's contents get updated, and vice versa π
ngl, a bunch of these are just "go read the calendar man page" and that's so valid of them. the calendar page is the main character here π«Ά
π WIDGET COMMAND π
just one command, and it's the good one:
pathname getβ returns the selected date ποΈ
π¦ DEFAULT BINDINGS π¦
the moment the dateentry widget is created, these bindings get installed. for navigation within the calendar itself, go check its manpage, bestie.
- Button-1 β accept and select the date and close the calendar window π±οΈ
- Return, space β accept the selected date and close the calendar window β¨οΈ
- Escape β close calendar window π
- Control-space β show calendar window β¨
not me memorizing these β Ctrl+space to pop the calendar open, Escape to bail. iconic.
π EXAMPLE π
here's the whole vibe, copy it exactly:
package require widget::dateentry; # or widget::all
set t [widget::dateentry .de]
pack $t -fill x -expand 1
three lines, a whole date picker, we ate π₯
π BUGS, IDEAS, FEEDBACK π
real talk: this document, and the package it describes, will undoubtedly contain bugs and other problems. that's just how it is π. please report them in the category widget::dateentry of the Tklib Trackers at [http://core.tcl.tk/tklib/reportlist].
also please report any ideas for enhancements you may have for either the package and/or the documentation. we want all of it, fr fr π«Ά
β KEYWORDS β
date, dateentry, megawidget, snit, widget
π CATEGORY π
Widget
okay bye bestie, go pick some dates π
mwah π β this page is from tklib, version 0.96, and it's the widget_dateentry(n) manual page. see u in the group chat π
π¦ where this page comes from
- alpine 3.24: tk-lib-doc 0.7-r0 Β· TCL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms