Adding a record
Now that we have an interface it would be nice to have records. To accomplish this, we need to give the user the ability to add a record including a photo if desired. This will require that we set up our variables to support adding a record, clear the interface, associate a picture to the entry and then save the record when the user is complete as well as a procedure to load the record for display.
How to do it…
In the address book file, enter the following text at the location defined in our main page for procedures as defined within the comments:
proc addRecord {} { global currentRecord global recordCount global addressInfo global pictureFile # Clear current entries clearRecord set pictureFile "" set currentRecord [expr $recordCount +1] } # Clear any contents from the entry widgets proc clearRecord {} { .main.efirst delete 0 end .main.elast delete 0 end .main.eaddress delete 0 end .main.ecity delete 0 end .main.estate delete 0 end .main.ezip delete 0 end .main.ephone delete...