Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Tcl/Tk 8.5 Programming Cookbook

You're reading from   Tcl/Tk 8.5 Programming Cookbook 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.

Arrow left icon
Product type Paperback
Published in Feb 2011
Publisher Packt
ISBN-13 9781849512985
Length 236 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (20) Chapters Close

Tcl/Tk 8.5 Programming Cookbook
Credits
About the Author
1. Acknowledgment
About the Reviewers
2. www.PacktPub.com
3. Preface
1. The Tcl Shell FREE CHAPTER 2. Using the Building Blocks Control Constructs 3. Error Handling 4. Handling String Expressions 5. Expanding String Functionality Using Lists 6. The Tcl Dictionary 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

Preface

Created in 1988 by John Ousterhoult, while working at the University of Califormia, Berkeley, Tcl (Tool Command Language) is a scripting language originally designed for embedded system platforms. Since its creation, Tcl has grown far beyond its original design with numerous expansions and additions (such as the graphical Took Kit or Tk) to become a full-featured scripted programming language capable of creating elegant, cross-platform solutions.

This book is written for both the beginning developer looking for a instructions on how to get their application up and running quickly to the experienced Tcl/Tk programmer looking to sharpen their skills. You will find everything from utilization of the console commands through to the creation of a stand-alone application.

What this book covers

Chapter 1, The Tcl Shell, gives an introduction to the Tcl shell.

Chapter 2, Using the Building Blocks Control Constructs, talks about using control constructs (if statements, for statements, and so on) to perform control program flow.

Chapter 3, Error Handling, talks about using the built-in commands and the Tcl shell to perform error handling.

Chapter 4, Handling String Expressions, explains how to create, manipulate, and manage string variables.

Chapter 5, Expanding String Functionality Using List, shows how to create, manipulate, and manage data in Tcl lists.

Chapter 6, The Tcl Dictionary, explains how to create, manipulate, and manage data in Tcl dictionaries.

Chapter 7, File Operations, tells how to open, read, write, and configure access to files stored on the system.

Chapter 8, Tk GUI Programming with Tcl/Tk, gives an introduction to the Tk shell, creating and managing a widget or window.

Chapter 9, Configuring and Controlling Tk Widgets, explains about creating and managing the most commonly used Tk widgets.

Chapter 10, Geometry Management, talks about managing the layout and design of the window.

Chapter 11, Using Tcl Built-In Dialog Windows, is about the creation and use of the Tcl built-in dialog windows available in Tk.

Chapter 12, Creating and Managing Menus, explains creating and managing menus, menu buttons, and pop-up menus.

Chapter 13, Creating the Address Book Application, gives full code listing and description of an Address Book application that makes use of the information covered in the previous sections.

What you need for this book

To complete the recipes covered in this book you will need the following:

  • A computer running any supported operating system (Window, Linux, Mac OSX, and so on)

  • A standard installation of Tcl/Tk

  • A non-formatting text editor such as Notepad

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 perfect 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.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The catch construct is used to prevent errors from aborting a script."

A block of code is set as follows:

If {[catch {set doubled [expr $value * 2]} errmsg]} {
puts "Script Failed - $errmsg"
} else {
puts "$value doubled is: $doubled"
}

Any command-line input or output is written as follows:

% unset x
%

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "If the user clicks on the Cancel button, an empty string is returned."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Note

Downloading the example code for this book

You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image