Previous: Message widgets
Up: Widgets
Next: Listbox widgets
Previous Page: Message widgets
Next Page: Listbox widgets

Entry widgets

Entry widgets provide entry boxes for data entry, and are defined as shown:

entry .entrybox1  -textvariable variable
     pack  .entrybox1

Although this entry box is valid, it is difficult for the use to see it, since it has no bounding box marked out. The following is easier for the user

entry .entrybox2 -relief ridge -textvariable variable
     pack  .entrybox2

The textvariable configuration option associates the entry box with a TCL variable variable.

It may be better to determine a width for an entry box, since the system defaults may be too small. This can be done as follows:

entry .entrybox3 -width 30 -relief groove -textvariable variable
     pack  .entrybox3

Using wish, try out the three entry boxes here, and enter data into the boxes. Monitor the variables by using the TCL command

puts $variable

as data is typed in. As with the other widgets so far discussed, the entry widget has a largely similar range of configuration options.

csstddm@brunel.ac.uk
Fri Aug 19 16:55:19 BST 1994