NAME
iwidgets::entryfield - Create and manipulate a entry field widget
SYNOPSIS
iiwwiiddggeettss::::eennttrryyffiieelldd pathName ?options? IINNHHEERRIITTAANNCCEEitk::Widget <- iwidgets::LabeledWidget <- iwidgets::Entryfield
SSTTAANNDDAARRDD OOPPTTIIOONNSS bbaacckkggrroouunndd bboorrddeerrWWiiddtthh ccuurrssoorr eexxppoorrttSSeelleeccttiioonn ffoorreeggrroouunndd hhiigghhlliigghhttCCoolloorr hhiigghhlliigghhttTThhiicckknneessss iinnsseerrttBBaacckkggrroouunndd iinnsseerrttBBoorrddeerrWWiiddtthh iinnsseerrttOOffffTTiimmee iinnsseerrttOOnnTTiimmee iinnsseerrttWWiiddtthh jjuussttiiffyy rreelliieeff sseelleeccttBBaacckkggrroouunndd sseelleeccttBBoorrddeerrWWiiddtthh sseelleeccttFFoorreeggrroouunndd tteexxttVVaarriiaabbllee wwiiddtthh See the "options" manual entry for details on the standard options. AASSSSOOCCIIAATTEEDD OOPPTTIIOONNSS sshhooww ssttaattee See the "entry" manual entry for details on the associated options. IINNHHEERRIITTEEDD OOPPTTIIOONNSS ddiissaabblleeddFFoorreeggrroouunndd llaabbeellBBiittmmaapp llaabbeellFFoonnttllaabbeellIImmaaggee llaabbeellMMaarrggiinn llaabbeellPPooss llaabbeellTTeexxtt llaabbeellVVaarriiaabbllee ssttaattee ssttiicckkyy See the "labeledwidget" class manual entry for details on the inherited options.WWIIDDGGEETT-SSPPEECCIIFFIICC OOPPTTIIOONNSS
Name: cchhiillddSSiitteePPooss Class: PPoossiittiioonnCommand-Line Switch: -cchhiillddssiitteeppooss
Specifies the position of the child site in the entry field: nn, ss, ee, or ww. The default is e. Name: ccoommmmaanndd Class: CCoommmmaannddCommand-Line Switch: -ccoommmmaanndd
Specifies a Tcl command to be executed upon detection of a Return key press event. Name: ffiixxeedd Class: FFiixxeeddCommand-Line Switch: -ffiixxeedd
Restrict entry to the specified number of chars. A value of 0,which is the default, denotes no limit. The value is the maxi-
mum number of chars the user may type into the field, regardles of field width. For example, if the field width is set to 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. Name: ffooccuussCCoommmmaanndd Class: CCoommmmaannddCommand-Line Switch: -ffooccuussccoommmmaanndd
Specifies a Tcl command to be executed upon reception of focus. Name: iinnvvaalliidd Class: CCoommmmaannddCommand-Line Switch: -iinnvvaalliidd
Specifies a Tcl command to be executed upon determination of invalid input. The default is bell. Name: tteexxttBBaacckkggrroouunndd Class: BBaacckkggrroouunnddCommand-Line Switch: -tteexxttbbaacckkggrroouunndd
Background color for inside textual portion of the entry field.The value may be given in any of the forms acceptable to TTkkGGeett-
CCoolloorr. Name: tteexxttFFoonntt Class: FFoonnttCommand-Line Switch: -tteexxttffoonntt
Name of font to use for display of text in entryfield. The value may be given in any of the forms acceptable to TTkkGGeettFFoonntt. Name: ppaassttiinngg Class: BBeehhaavviioorrCommand-Line Switch: -ppaassttiinngg
Option to enable/disable pasting into the entry component of the entryfield. Valid values are 0 (disabled) or 1 (enabled). Defaults to 1. Name: vvaalliiddaattee Class: CCoommmmaannddCommand-Line Switch: -vvaalliiddaattee
The validate option allows specification of a validation mecha-
nism. Standard character validation such as nnuummeerriicc, aallpphhaa-
bbeettiicc, iinntteeggeerr, hheexxiiddeecciimmaall, rreeaall, and aallpphhaannuummeerriicc can be han-
dled through the use of keywords. Should more extensive valida-
tion be necessary, the value may contain the name of a command script. The script should return a boolean value. True forvalid, false for invalid. If false is returned, then the proce-
dure associated with the invalid option will be invoked. If thevalidation script contains any %% characters, then the script
will not be executed directly. Instead, a new script will begenerated by replacing each %%, and the character following it,
with information from the entryfield. The replacement dependson the character following the %%, as defined in the list below.
%%cc Replaced with the current input character.
%%PP 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.%%SS Replaced with the current contents of the entryfield prior to
the latest keystroke being added.%%WW Replaced with the entryfield widget pathname.
DESCRIPTION
The iiwwiiddggeettss::::eennttrryyffiieelldd command creates an enhanced text entry widgetwith an optional associated label. Addtional options support valida-
tion and establishing a upper limit on the number of characters which may be entered in the field. MMEETTHHOODDSS The iiwwiiddggeettss::::eennttrryyffiieelldd 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: AASSSSOOCCIIAATTEEDD MMEETTHHOODDSS ddeelleettee ggeett iiccuurrssoorr iinnddeexx iinnsseerrtt ssccaann sseelleeccttiioonn xxvviieeww See the "entry" manual entry for details on the associated methods.WWIIDDGGEETT-SSPPEECCIIFFIICC MMEETTHHOODDSS
pathName ccggeett option Returns the current value of the configuration option given byoption. Option may have any of the values accepted by the iiwwiidd-
ggeettss::::eennttrryyffiieelldd command. pathName cchhiillddssiittee Returns the path name of the child site. pathName cclleeaarr Clear entry widget pathName ccoonnffiigguurree ?option? ?value option value ...? Query or modify the configuration options of the widget. If nooption is specified, returns a list describing all of the avail-
able options for pathName (see TTkkCCoonnffiigguurreeIInnffoo for information 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 ormore option-value pairs 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. Option may have any of the values accepted by the iiwwiiddggeettss::::eennttrryyffiieelldd command. CCOOMMPPOONNEENNTTSS Name: eeffcchhiillddssiittee Class: ffrraammee 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: eennttrryy Class: eennttrryy 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. EEXXAAMMPPLLEE 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 .pefpack .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
AUTHOR Sue Yockey Mark L. Ulferts KKEEYYWWOORRDDSS entryfield, widget Tk iwidgets::entryfield(1)