iwidgets::timefield(1)

πŸ’– iwidgets::timefield β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to iwidgets::timefield from the [incr Widgets] collection. yes it's a whole manual page, no it's not boring, sit down, hydrate, let's go 🫢


✨ NAME ✨

iwidgets::timefield β€” bestie, this makes and drives a time field widget. it's the widget. that's the vibe. periodt πŸ’…


🌸 SYNOPSIS 🌸

iwidgets::timefield pathName ?options?

that's it. that's the whole summoning ritual. pathName is your widget's name, ?options? is whatever you wanna pass ✨


πŸ¦‹ INHERITANCE πŸ¦‹

the family tree, and yes she comes from a good family:

itk::Widget <- iwidgets::LabeledWidget <- iwidgets::Timefield

itk::Widget is the ancestor, iwidgets::LabeledWidget is the parent, and iwidgets::Timefield is the main character πŸ’…


πŸŽ€ STANDARD OPTIONS πŸŽ€

these are the classics, she inherited them, she's wearing them well:

  • background
  • borderWidth
  • cursor
  • exportSelection
  • foreground
  • highlightColor
  • highlightThickness
  • insertBackground
  • justify
  • relief
if you want the deets on any of these, go read the "options" manual entry. she's not gonna re-explain her whole wardrobe, iykyk ✨

🌈 INHERITED OPTIONS 🌈

these come from the labeled-widget side of the family:

  • disabledForeground
  • labelBitmap
  • labelFont
  • labelImage
  • labelMargin
  • labelPos
  • labelText
  • labelVariable
  • state
  • sticky
full tea on all of these lives in the "labeledwidget" class manual entry 🫢

πŸ’… WIDGET-SPECIFIC OPTIONS πŸ’…

okay THIS is the section, this is where she gets specific, this is the good stuff πŸ“

  • -childsitepos (Name: childSitePos, Class: Position) β€” says where the child site sits inside the time field. your choices are n, s, e, or w. the default is e. iconic default, honestly.
  • -command (Name: command, Class: Command) β€” a Tcl command that gets run when a Return key press event is detected. so like, you press Return, she does the thing. slay.
  • -gmt (Name: gmt, Class: Gmt) β€” decides whether the time is calculated relative to Greenwich Mean Time. takes a boolean value. the default is no.
  • -state (Name: state, Class: State) β€” the state of the timefield, and there are exactly two options: normal or disabled. if she's disabled then input is not accepted, that's it, door's closed bestie. the default is normal.
  • -textbackground (Name: textBackground, Class: Background) β€” the background color for the inside textual portion of the entry field. the value can be in any of the forms acceptable to Tk_GetColor.
  • -textfont (Name: textFont, Class: Font) β€” the name of the font used to display text in the timefield. the value can be given in any of the forms acceptable to Tk_GetFont.

πŸ‘‘ DESCRIPTION πŸ‘‘

iwidgets::timefield creates an enhanced text entry widget whose whole purpose in life is time entry, and she comes with various degrees of built-in intelligence. she's smart. she knows what a time is. she will tell you if you're wrong. we love a self-aware widget πŸ’–


✨ METHODS ✨

the iwidgets::timefield command creates a brand new Tcl command whose name is pathName. you use that command to do operations on the widget. general form, look:

pathName option ?arg arg ...?

option plus the args decide exactly what the command does. here's what's on the menu for timefield widgets, babes:

πŸ’« WIDGET-SPECIFIC METHODS πŸ’«

  • pathName cget option β€” returns the current value of the configuration option given by option. and option can be any of the values that the iwidgets::timefield command accepts. peek at the settings, no notes πŸ’…
  • pathName configure ?option? ?value option value ...? β€” query or modify the widget's configuration options. if you pass no option at all, she returns a list describing all the available options for pathName (go look at Tk_ConfigureInfo if you wanna know the format of that list). if you give option with no value, you get a list describing that one named option β€” and that list will be identical to the corresponding sublist of the value you'd get if you hadn't specified any option. and if you pass one or more option-value pairs, she modifies the given widget option(s) to have the given value(s), and in that case the command returns an empty string. option may have any of the values accepted by the iwidgets::timefield command.
  • pathName get ?format? β€” returns the current contents of the timefield, in a format of string or as an integer clock value, using the -string and -clicks format options respectively. the default is by string. go reference the clock command if you want more info on obtaining times and their formats πŸ•
  • pathName isvalid β€” returns a boolean indication of whether the currently displayed time value is valid. example, because examples are everything: 12:59:59 is valid, whereas 25:59:59 is invalid. she said 25 o'clock is not a thing, bestie 😭
  • pathName show time β€” changes the currently displayed time to be that of the time argument. time can be specified as a string, an integer clock value, or the keyword "now" (which is the default). reference the clock command for more info on obtaining times and their formats ✨

🧚 COMPONENTS 🧚

  • time (Class: Entry) β€” this component provides the entry field for time input and display. see the "entry" widget manual entry for the deets on the time component item.

🌟 EXAMPLE 🌟

here's the moment you've all been waiting for, the code, the whole code, nothing but the code:

package require Iwidgets 4.0
proc returnCmd {} {
  puts [.tf get]
}

iwidgets::timefield .tf -command returnCmd
pack .tf -fill x -expand yes -padx 10 -pady 10

she's built, she's packed, she's returning. ate and left no crumbs πŸ”₯


πŸ’œ AUTHOR πŸ’œ

John A. Tucker and Mark L. Ulferts β€” thank you for your service, kings πŸ‘‘


πŸŽ€ KEYWORDS πŸŽ€

timefield, widget


one tiny thing bestie: this page is part of Tk and it's the iwidgets::timefield(1) manual page. that's the source, that's the version, that's the name β€” no cap πŸ’– bye ily, go build something cute πŸ¦‹βœ¨
πŸ“¦ where this page comes from