Chapter 13. Creating the Address Book Application

In this chapter, we will cover:

  • Creating the address book application
  • Adding a record
  • Navigating records
  • Deleting a record
  • Finding a record
  • Full listing

Introduction

In the Address Book application, we will bring together everything covered within the previous chapters. This will include not only the Tcl commands and Tk widgets, but also the creation of global variables and calling Tcl procedures. We will leverage the flexibility of the dict command combined with the list command to read and write our data to disk in a manner similar to a database.

I have also added comments to clarify understanding of various sections. Although these comments are not necessary for the program to operate, you should add them to aid you in the event of any issues you might encounter.

Please note that I have intentionally used step-by-step methodology to complete several items, as opposed to a control construct methodology, to more clearly illustrate sections. For example, rather that storing the widgets in a list and creating them with a while statement, I have created them one by one.

To complete the following example, open the text editor of your choice and enter the text as directed. Then save the file in your path with the name address_book.tcl. Also, note that I have left code that will write messages to the console, based on specific actions to illustrate using the console output to debug your programs as you create them.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.179.220