Book description
With over 100 recipes, this Cookbook is ideal for both beginners and advanced Tcl/Tk programmers. From the basics to creating applications, it’s full of indispensable tips and tricks to make the most of the language.
- 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
In Detail
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
Table of contents
-
Tcl/Tk 8.5 Programming Cookbook
- Table of Contents
- Copyright
- Credits
- About the Author
- Acknowledgment
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. The Tcl Shell
- 2. Using the Building Blocks Control Constructs
- 3. Error Handling
-
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
-
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
-
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
- 7. File Operations
- 8. Tk GUI Programming with Tcl/Tk
- 9. Configuring and Controlling Tk Widgets
- 10. Geometry Management
- 11. Using Tcl Built-in Dialog Windows
- 12. Creating and Managing Menus
- 13. Creating the Address Book Application
- Index
Product information
- Title: Tcl/Tk 8.5 Programming Cookbook
- Author(s):
- Release date: February 2011
- Publisher(s): Packt Publishing
- ISBN: 9781849512985
You might also like
book
Perl Cookbook
The Perl Cookbook is a comprehensive collection of problems, solutions, and practical examples for anyone programming …
book
Tkinter GUI Programming by Example
Leverage the power of Python and its de facto GUI framework to build highly interactive interfaces …
book
Practical Programming in Tcl and Tk, Fourth Edition
Practical Programming in Tcl/Tk, 4th edition The Tcl/Tk bestseller fully updated for Tcl 8.4! Authoritative coverage …
book
Practical Programming in Tcl & Tk, Third Edition
2202H-5 The Tcl/Tk best-seller, now completely updated for Tcl 8.2 and the Tcl Web Server! Tcl/Tk …