Data entry application
We will now add a more complex menu to our data entry application. This menu will allow the user to manage the functionality of the application via the menu in the same manner as they would when using the buttons.
How to do it…
In the following example, we will create a menu that contains an option to exit a window. Create the following text file and save it in your working path with the name address_book.tcl:
# Load the Tk Package package require Tk # Main Frame frame .main -borderwidth 1 -relief solid -padx 10 -pady 10 # Entry Widgets entry .main.efirst -width 25 entry .main.elast -width 25 entry .main.eaddress -width 50 entry .main.ecity -width 25 entry .main.estate -width 3 entry .main.ezip -width 5 entry .main.ephone -width 25 # Label Widgets label .main.first -text "First Name" label .main.last -text "Last Name" label .main.address -text "Address" label .main.city -text "City" label .main.state -text "ST" label .main.zip -text "Zip" label .main.phone -text "Phone...