widget_calendar(3tk)

πŸ“¦
version 0.9 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– widget_calendar β€” bestie, it's a calendar πŸ’–

okay so this page lives in section 3tk of the manual (the Tk megawidget corner of the world), and it's all about widget_calendar, a whole Calendar Megawidget. yes. a calendar. in Tk. we're doing this. πŸ—“οΈβœ¨


🌸 NAME 🌸

widget_calendar β€” the Calendar Megawidget, aka your new favorite snidget πŸŽ€


✨ SYNOPSIS ✨

package require Tcl 8.4

package require Tk 8.4

package require widget ?3.0?

package require widget::calendar ?1.0.2?

widget::calendar pathname ?options?

like, you need Tcl 8.4 and Tk 8.4 minimum, then the widget package (version 3.0 or later, if you're asking), then widget::calendar itself (version 1.0.2 or later, pls), and then you just... make one with a pathname and some options. that's it. that's the whole ritual. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

this package hands you a calendar megawidget β€” and yes, the official word for it is a snidget, which is iconic and I will not be taking questions. 🫢

and here's the whole invocation, look at her:

widget::calendar pathname ?options?

πŸ‘‘ WIDGET OPTIONS πŸ‘‘

every single one, no skips, we love a complete list:

  • -command β€” a script to evaluate when a date was selected. like, "hey bestie, they picked a day" energy. πŸ””
  • -dateformat β€” the format of the date that gets returned. default: %m/%d/%Y. πŸ—“οΈ
  • -firstday β€” sets the first day of the week. either sunday or monday. it defaults to monday. (monday girlies, rise.) β˜€οΈ
  • -font β€” picks the font used in the widget. it defaults to Helvetica 9. πŸŽ€
  • -highlightcolor β€” picks the background color for the day that has been selected. default: #FFCC00. so golden, so main character. ✨
  • -language β€” specifies the language of the calendar contents. you give it language abbreviations, for example: en β€” english, de β€” german ... it defaults to en.

supported languages: de en es fr gr he it ja sv pl pt zh fi tr nl ru crk crx-nak crx-lhe 🌍

  • -shadecolor β€” picks the color of the parts that have a shaded background. default: #888888. 🩢
  • -showpast β€” says whether the past shall be shown. it's a boolean value and it defaults to 1. (yes, the past stays visible unless you say otherwise, bestie.) ⏳
  • -textvariable β€” specifies the name of 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. it's a two-way situationship. πŸ’ž

🧚 WIDGET COMMAND 🧚

pathname get ?what?

returns a part of the selected date, or all. the argument what selects which part. valid values for what are: day, month, year and all. all is the default and returns the complete date in the format given with -dateformat. 🌈


πŸ’œ DEFAULT BINDINGS πŸ’œ

when the calendar widget gets created, these bindings get installed. when you press a key, the command is invoked and the textvariable is updated. updated. (yes, it says it twice, and honestly? mood. 😭)

  • Home β€” move to the current date
  • Up β€” move to the week before the current date
  • Down β€” move to the week after the current date
  • Left β€” move to the day before the current date
  • Right β€” move to the day after the current date
  • Control-Left β€” move to the month before the current date
  • Control-Right β€” move to the month after the current date
  • Control-Up β€” move to the year before the current date
  • Control-Down β€” move to the year after the current date

lowkey the Control ones are the power moves. periodt. ⌨️πŸ”₯


πŸ“ EXAMPLE πŸ“

package require widget::calendar ; # or widget::all
set t [widget::calendar .t]
pack $t -fill x -expand 1

three lines. she ate. πŸ’…


πŸ’€ BUGS, IDEAS, FEEDBACK πŸ’€

this document, and the package it describes, will undoubtedly contain bugs and other problems. (their words, not mine, but also... yeah. πŸ™ˆ)

pls report such in the category widget::calendar of the Tklib Trackers at [http://core.tcl.tk/tklib/reportlist].

also pls report any ideas for enhancements you may have for either the package and/or the documentation. they want the feedback, fr fr. 🫢


🌟 KEYWORDS 🌟

calendar, date, megawidget, snit, widget


⭐ CATEGORY ⭐

Widget


and that's the whole page, bestie!! this beauty ships with tklib, version 1.0.2, and the page itself is dated widget_calendar(3tk) β€” so yeah, go build a calendar, you're gonna slay. no cap. πŸ’–πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from