iwidgets::entryfield(1)
โจ iwidgets::entryfield โจ
okay bestie, welcome to the manual page for iwidgets::entryfield, part of [incr Widgets]. this is the girlies' guide to making an entry field widget, and yes she's the upgraded version. ๐
NAME
iwidgets::entryfield โ create and manipulate a entry field widget ๐
SYNOPSIS
iwidgets::entryfield pathName ?options?
that's it. that's the whole summoning ritual. ๐
INHERITANCE
she comes from a whole lineage, and the family tree goes like this:
itk::Widget <- iwidgets::LabeledWidget <- iwidgets::Entryfield
so she inherits from iwidgets::LabeledWidget, which inherits from itk::Widget. iconic bloodline honestly. ๐
STANDARD OPTIONS
these are the classics, the everyday slays:
backgroundborderWidthcursorexportSelectionforegroundhighlightColorhighlightThicknessinsertBackgroundinsertBorderWidthinsertOffTimeinsertOnTimeinsertWidthjustifyreliefselectBackgroundselectBorderWidthselectForegroundtextVariablewidth
See the options manual entry for details on the standard options. that's where the lore lives. ๐
ASSOCIATED OPTIONS
two little borrowed faves:
showstate
See the entry manual entry for details on the associated options. she's sharing with her cousin. ๐ซถ
INHERITED OPTIONS
passed down from the ancestors, no cap:
disabledForegroundlabelBitmaplabelFontlabelImagelabelMarginlabelPoslabelTextlabelVariablestatesticky
See the labeledwidget class manual entry for details on the inherited options. ๐
WIDGET-SPECIFIC OPTIONS
okay this is the main character section. buckle up. ๐ฆ
- Name:
childSitePosClass:PositionCommand-Line Switch:-childsitepos
says where the child site sits inside the entry field: n, s, e, or w. the default is e. compass girlie behavior. ๐งญ
- Name:
commandClass:CommandCommand-Line Switch:-command
a Tcl command to run the second a Return key press event is detected. press enter, things happen. โจ
- Name:
fixedClass:FixedCommand-Line Switch:-fixed
locks the entry down to a set number of chars. a value of 0 โ which is the default โ means no limit at all, live your life. the value is the max number of chars the user may type into the field, regardles of field width. like for example: if the field width is 20 and the fixed value is 10, the user will only be able to type 10 characters into the field which is 20 characters long. the vibes are constrained but the box is big. ๐ญ
- Name:
focusCommandClass:CommandCommand-Line Switch:-focuscommand
a Tcl command to run when she receives focus. she's paying attention now. ๐
- Name:
invalidClass:CommandCommand-Line Switch:-invalid
a Tcl command to run when invalid input gets detected. the default is bell. ๐
- Name:
textBackgroundClass:BackgroundCommand-Line Switch:-textbackground
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. ๐จ
- Name:
textFontClass:FontCommand-Line Switch:-textfont
name of the font used to display text in the entryfield. the value may be given in any of the forms acceptable to Tk_GetFont. typography moment fr fr. ๐ค
- Name:
pastingClass:BehaviorCommand-Line Switch:-pasting
enable or disable pasting into the entry component of the entryfield. valid values are 0 (disabled) or 1 (enabled). defaults to 1. yes bestie you can paste, unless you choose chaos. ๐
- Name:
validateClass:CommandCommand-Line Switch:-validate
the validate option lets you set up a whole validation mechanism. standard character validation like numeric, alphabetic, integer, hexidecimal, real, and alphanumeric can all be handled through the use of keywords. and if you need something more extensive, the value may contain the name of a command script. the script should return a boolean value. True for valid, false for invalid. if false is returned, then the procedure associated with the invalid option will be invoked. ๐
and here's the spicy part: if the validation script contains any % characters, then the script will not be executed directly. instead, a new script will be generated by replacing each %, and the character following it, with information from the entryfield. the replacement depends on the character following the %, as defined in the list below. ๐
%cโ replaced with the current input character.%Pโ replaced with the contents of the entryfield modified to include the latest keystoke. this is equivalent to peeking at the future contents, enabling rejection prior to the update. she's a time traveler lowkey. ๐ฎ%Sโ replaced with the current contents of the entryfield prior to the latest keystroke being added.%Wโ replaced with the entryfield widget pathname.
DESCRIPTION
the iwidgets::entryfield command creates an enhanced text entry widget with an optional associated label. addtional options support validation and establishing a upper limit on the number of characters which may be entered in the field. she's an entry field but make it extra. ๐ธ
METHODS
the iwidgets::entryfield command creates a new Tcl command whose name is pathName. this command may be used to invoke various operations on the widget. it has the following general form:
pathName option ?arg arg ...?
option and the args determine the exact behavior of the command. the following commands are possible for entryfield widgets: ๐ซ
ASSOCIATED METHODS
the borrowed besties:
deletegeticursorindexinsertscanselectionxview
See the entry manual entry for details on the associated methods. ๐ซถ
WIDGET-SPECIFIC METHODS
the ones she brought herself:
pathName cget optionโ returns the current value of the configuration option given byoption.optionmay have any of the values accepted by theiwidgets::entryfieldcommand.pathName childsiteโ returns the path name of the child site. ๐pathName clearโ clear entry widget. poof. gone. ๐งนpathName configure ?option? ?value option value ...?โ query or modify the configuration options of the widget. if nooptionis specified, returns a list describing all of the available options forpathName(seeTk_ConfigureInfofor information on the format of this list). ifoptionis 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 moreoption-valuepairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string.optionmay have any of the values accepted by theiwidgets::entryfieldcommand. the whole shebang. ๐
COMPONENTS
- Name:
efchildsiteClass:frame
the efchildsite component is the user child site for the entry field. See the frame widget manual entry for details on the efchildsite component item. ๐ผ๏ธ
- Name:
entryClass:entry
the entry component provides the entry field for user text input and display. See the entry widget manual entry for details on the entry component item. โ๏ธ
EXAMPLE
here's the whole fit, styled and ready:
package require Iwidgets 4.0
option add *textBackground white
proc returnCmd {} {
puts stdout "Return Pressed"
}
proc invalidCmd {} {
puts stdout "Alphabetic contents invalid"
}
iwidgets::entryfield .ef -command returnCmd
iwidgets::entryfield .fef -labeltext "Fixed:" -fixed 10 -width 12
iwidgets::entryfield .nef -labeltext "Numeric:" -validate numeric
-width 12
iwidgets::entryfield .aef -labeltext "Alphabetic:" \
-validate alphabetic -width 12 -invalid invalidCmd
iwidgets::entryfield .pef -labeltext "Password:" \
-show 267 -width 12 -command returnCmd
iwidgets::Labeledwidget::alignlabels .ef .fef .nef .aef .pef
pack .ef -fill x -expand yes -padx 10 -pady 5
pack .fef -fill x -expand yes -padx 10 -pady 5
pack .nef -fill x -expand yes -padx 10 -pady 5
pack .aef -fill x -expand yes -padx 10 -pady 5
pack .pef -fill x -expand yes -padx 10 -pady 5
align those labels, pack those frames, and serve. ๐
AUTHOR
Sue Yockey Mark L. Ulferts
(legends. both of them. ๐)
KEYWORDS
entryfield, widget
and that's the whole page bestie!! this manual comes to you from Tk, page iwidgets::entryfield(1) โ go forth and make entry fields that eat. โจ๐ no cap. ๐ฆ
๐ฆ 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) 1995 DSC Technologies Corporation
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms