Tcl/Tk 8.5 Programming Cookbook

Tcl/Tk 8.5 Programming Cookbook
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • 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 : English
Paperback : 236 pages [ 235mm x 191mm ]
Release Date : February 2011
ISBN : 1849512981
ISBN 13 : 9781849512985
Author(s) : Bert Wheeler
Topics and Technologies : All Books, Networking and Servers, Cookbooks, Open Source

Table of Contents

Chapter 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
  • 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 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 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

                            Bert Wheeler

                            After completing 20 years of military service, Bert returned to college to pursue a career in software development. He has worked in the IT industry for over 10 years in numerous roles from software development to Director of Engineering Services. He is currently employed by a Fortune-500 company as a technical resource to assist worldwide development teams in implementation of their products through various SDK packages in multiple languages and Operating Systems. Bert has been an active contributor to the open source community in the area of Computer Visualization and developing applications with Artificial Intelligence-based learning capabilities.
                            Sorry, we don't have any reviews for this title yet.

                            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.

                            Frequently bought together

                            Tcl/Tk 8.5 Programming Cookbook +    jQuery UI 1.10: The User Interface Library for jQuery =
                            50% Off
                            the second eBook
                            Price for both: €28.20

                            Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                            What you will learn from this book

                            • 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

                            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


                            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.

                            Who this book is for

                            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

                            Code Download and Errata
                            Packt Anytime, Anywhere
                            Register Books
                            Print Upgrades
                            eBook Downloads
                            Video Support
                            Contact Us
                            Awards Voting Nominations Previous Winners
                            Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                            Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software