Tcl/Tk 8.5 Programming Cookbook
Formats:
save 15%!
save 37%!
Free Shipping!
| Also available on: |
|
- The quickest way to solve your problems with Tcl/Tk 8.5
- Understand the basics and fundamentals of the Tcl/Tk 8.5 programming language
- Learn graphical User Interface development with the Tcl/Tk 8.5 Widget set
- Get a thorough and detailed understanding of the concepts with a real-world address book application
- Each recipe is a carefully organized sequence of instructions to efficiently learn the features and capabilities of the Tcl/Tk 8.5 language
Book Details
Language : EnglishPaperback : 236 pages [ 235mm x 191mm ]
Release Date : February 2011
ISBN : 1849512981
ISBN 13 : 9781849512985
Author(s) : Bert Wheeler
Topics and Technologies : All Books, Cookbooks, Open Source
Table of Contents
PrefaceChapter 1: The Tcl Shell
Chapter 2: Using the Building Blocks Control Constructs
Chapter 3: Error Handling
Chapter 4: Handling String Expressions
Chapter 5: Expanding String Functionality Using Lists
Chapter 6: The Tcl Dictionary
Chapter 7: File Operations
Chapter 8: Tk GUI Programming with Tcl/Tk
Chapter 9: Configuring and Controlling Tk Widgets
Chapter 10: Geometry Management
Chapter 11: Using Tcl Built-in Dialog Windows
Chapter 12: Creating and Managing Menus
Chapter 13: Creating the Address Book Application
Index
- Chapter 1: The Tcl Shell
- Introduction
- The Tcl shell
- Writing to the Tcl console
- Mathematical expressions
- Tcl expr operands
- Mathematical functions
- Computing mathematical expressions
- Referencing files in Tcl
- Variables
- Command line arguments
- Chapter 2: Using the Building Blocks Control Constructs
- Introduction
- Controlling flow with the if statement
- Looping with for
- Looping with foreach
- Looping with while
- Continuing a procedure
- Breaking out of a procedure
- Nested looping
- Chapter 3: Error Handling
- Introduction
- Using the catch command
- Using the eval command
- Using the error command
- Error handling procedure
- Chapter 4: Handling String Expressions
- Introduction
- Appending to a string
- Formatting a string
- Matching a regular expression within a string
- Performing character substitution on a string
- Parsing a string using conversion specifiers
- Determining the length of a string
- Comparing strings
- Comparing a string of characters
- Locating the first instance of a character
- Locating the index of a character
- Determining the class of a string
- Locating the last instance of a string
- Determining the size of a string
- Replacing values within a string
- Locating a pattern within a string
- Returning a range of characters from a string
- Creating a string of repeated characters
- Replacing ranges of characters contained within a string
- Creating a reverse string
- Converting a string to lowercase
- Converting a string to title
- Converting a string to uppercase
- Trimming a string
- Trimming leading whitespace
- Trimming trailing whitespace
- Locating the word end
- Locating the word start
- Performing variable substitution
- Chapter 5: Expanding String Functionality Using Lists
- Introduction
- Creating a list
- Joining two lists
- Joining list elements
- Appending list elements
- Assigning list elements to variables
- Retrieving an element from a list
- Inserting elements into a list
- Determining the number of elements
- Getting a list element
- Repeating elements
- Replacing elements
- Reversing elements
- Searching a list
- Editing a list
- Sorting a list
- Splitting a string into a list
- Chapter 6: The Tcl Dictionary
- Introduction
- Creating a dictionary
- Appending to a dictionary
- Determining if a key exists
- Filtering a dictionary
- Searching a dictionary
- Getting a record
- Incrementing a value
- Getting the dictionary structure
- Getting a list of keys
- Appending to an existing record
- Merging two dictionaries
- Creating a blank dictionary structure
- Updating variables from a dictionary
- Determining the size of a dictionary
- Getting all records
- Assigning values
- Chapter 7: File Operations
- Introduction
- Opening a file
- Configuring a file
- Opening a command pipeline
- Writing a file
- Reading a file
- Closing a file
- File handling
- Chapter 8: Tk GUI Programming with Tcl/Tk
- Introduction
- Creating a widget
- Writing to the console
- Setting the attributes of the window through window manager
- Creating an additional window
- Destroying a window
- Creating a custom dialog
- Chapter 9: Configuring and Controlling Tk Widgets
- Introduction
- Creating a frame widget
- Creating a label widget
- Creating an entry widget
- Creating a button widget
- Creating a listbox widget
- Creating an image
- Creating a simple form
- Chapter 10: Geometry Management
- Introduction
- Controlling layout with the pack command
- Controlling layout with the grid command
- Combining pack and grid
- Creating an address book interface
- Chapter 11: Using Tcl Built-in Dialog Windows
- Introduction
- Displaying a message box
- Displaying a confirmation dialog
- Displaying the color picker
- Displaying the directory dialog
- Displaying the file selection dialog
- Selecting a directory and file
- Chapter 12: Creating and Managing Menus
- Introduction
- Creating a menu
- Adding menu buttons
- Displaying a pop-up menu
- Data entry application
- Chapter 13: Creating the Address Book Application
- Introduction
- Creating the Address Book application
- Adding a record
- Navigating records
- Deleting a record
- Finding a record
- Full listing
Bert Wheeler
Code Downloads
Download the code and support files for this book.
Submit Errata
Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.
Sample chapters
You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.
- Expand your Tcl/Tk abilities by gaining in-depth knowledge of the core commands
- Learn efficient programming by using control constructs in your program
- Handle numerous types of string expressions by performing formatting, searches, and advanced manipulations on them
- Gain expertise in using lists with examples teaching you the various available operations
- Demystify the Tcl Dictionary and learn how it can be a viable substitute for a third-party database
- Perform various operations on the dictionary elements in both single and multiple layer dictionaries
- Create, manage, and empower your Graphical User Interface with Tk window management, to develop attractive applications
- Ease your file system access with an in-depth study of File operations
- Perform advanced error trapping and recovery with error handling commands in Tcl
With Tcl/Tk, you can create full-featured cross-platform applications in a simple and easy-to-understand way without any expensive development package; the only tools required are a simple text editor and your imagination. This practical cookbook will help you to efficiently interact with editors, debuggers, and shell type interactive programs using Tcl/Tk 8. This cookbook will comprehensively guide you through practical implementation of Tcl/Tk 8.5 commands and tools.
This book will take you through all the steps needed to become a productive programmer in Tcl/Tk 8. Right from guiding you through the basics to creating a stand-alone application, it provides complete explanation of all the steps along with handy tips and tricks.
The book begins with an introduction to the Tcl shell, syntax, variables, and programming best practices in the language. It then explores procedures and the flow of events with control constructs followed by advanced error trapping and recovery. From Chapter 4, a detailed study of string expressions and handling enables you to handle various string functions and use lists to expand the string functionality. The book then discusses in-depth the Tcl Dictionary and how to utilize it to store and retrieve data. File operations and Tk GUI handling are covered extensively along with a developing a real-world address book application to practice the concepts learned.
A practical, comprehensive cookbook to master the depths and breadths of Tcl/Tk 8.5 programming
This book provides a step-by-step approach to the Tcl/Tk language with the help of re-usable examples and images. It is a series of carefully organized, easy-to-follow, standalone recipes to solve your queries. Whether you go through the recipes chapter-wise or pick up any recipe randomly, you will find clear and complete explanation of the task covered in the recipe.
If you are a beginner interested in adding Tcl/Tk 8.5 to your list of languages, or an experienced Tcl/Tk programmer looking to sharpen your knowledge, be assured, you will find your prefect guide in this book. Whether you are developing for your personal use or commercial applications, this book will provide you with a ready reference to the building blocks of Tcl/Tk 8.5

