![Tcl/Tk in a Nutshell: A Desktop Quick Reference](http://img.images-bn.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
![Tcl/Tk in a Nutshell: A Desktop Quick Reference](http://img.images-bn.com/static/redesign/srcs/images/grey-box.png?v11.9.4)
Paperback(1976. Corr. 5th Printing ed.)
-
PICK UP IN STORECheck Availability at Nearby Stores
Available within 2 business hours
Related collections and offers
Overview
- Core Tcl and Tk commands and Tk widgets
- C interface (prototypes)
- Expect
- [incr Tcl] and [incr Tk]
- Tix
- TclX
- BLT
- Oratcl, SybTcl, and Tclodbc
Product Details
ISBN-13: | 9781565924338 |
---|---|
Publisher: | O'Reilly Media, Incorporated |
Publication date: | 03/01/1999 |
Series: | In a Nutshell (O'Reilly) |
Edition description: | 1976. Corr. 5th Printing ed. |
Pages: | 454 |
Sales rank: | 938,229 |
Product dimensions: | 6.00(w) x 9.00(h) x 0.92(d) |
About the Author
When Jeff Tranter was first exposed to UNIX-based workstations about ten years ago, he dreamed of being able to afford a system with similar capabilities for home use. Today, he sees Linux as the realization of that dream, with the added bonus of being able to examine and modify all of the source code and even contribute to its development. He's been using Linux since 1992 and is the author of the freely available Linux Sound and CD-ROM HOWTO guides. Jeff has also written a number of Linux utilities and several Linux related magazine articles. Jeff received his bachelor's degree in electrical engineering from the Universityof Western Ontario. He currently works as a software designer for a high-tech telecommunications company in Kanata, Ontario, Canada's Silicon Valley North.
Read an Excerpt
Chapter 1: Introduction
This chapter presents a brief history of and an introduction to the Tcl language and describes how this book is organized.
What Is Tcl?
In the early 1980s John Ousterhout, then at the University of California at Berkeley, was working with a group that developed hardware design tools. They found that they kept inventing a new scripting language with each new tool they developed. It was always added as an afterthought and poorly implemented. John decided to create a general-purpose scripting language that could be reused when developing new tools. He called the language Tcl, for tool command language, made it freely available for download, and presented it at the Winter 1990 USENIX conference. It soon became popular, with an estimated 50 Tcl applications written or in development one year later.One of the attendees at Ousterhout's presentation, Don Libes, saw the applicability of Tcl to a problem he was working on. Within a few weeks he developed the first version of Expect, which became the first killer application for Tcl, driving many people to install Tcl who might have otherwise ignored it.
Ousterhout's philosophy is to embed a scripting language inside applications. Combining the advantages of a compiled language like C (portability, speed, access to operating system functions) with those of a scripting language (ease of learning, runtime evaluation, no compilation) gives an overall reduction in development time and opportunities for creating small, reliable, and reusable software components. An application with an embedded Tcl interpreter can be extended and customized by the end user in countless ways.
The Tcl interpreter has a well-defined interface and is typically built as an object library, making it easy to extend the basic language with new commands. Tcl can also be used as a prototyping language. An application can be written entirely in Tcl, and once the design is proven, critical portions can be rewritten in C for performance reasons.
A year later, at the Winter USENIX conference, Ousterhout presented Tk, a graphical toolkit for Tcl that made it easy to write applications for the X11 windowing system. it also supported the send command, a simple yet powerful way to allow Tk applications to communicate with each other.
Since then, with dozens of Tcl extensions, many of them designed to solve problems related to specific domains such as graphics and relational databases, the Tcl programming environment has become even more powerful. Today, Tcl runs on Unix, Macintosh, and Windows platforms, and even inside a web browser. It has a huge installed base of users and applications, both free and commercial. As Tcl approaches its tenth anniversary, it is poised to continue its growth in popularity.
Structure of This Book
Following this brief introduction, Chapter 2 covers the core features of the Tcl language itself. Chapter 3 covers Tk, the graphical user interface (GUI) toolkit that is probably the most popular Tcl extension. Chapter 4 covers the C-language application programming interface for Tcl, and Chapter 5 does the same for Tk.Each language extension chapter follows a similar format: after a brief introduction, any special global and environment variables are described, followed by a logically grouped summary of the commands. The heart of each chapter is an alphabetical summary of each command that lists the options in detail. Short programming examples are provided for the more complex commands.
Chapter 6 covers Expect, the first popular application to be built using Tcl. Chapter 7 is on [incr Tcl], which adds object-oriented programming features to Tcl. Chapter 8 covers [incr Tk], a framework for object-oriented graphical widgets built using [incr Tcl].
Chapter 9 covers Tix, a Tk extension that adds powerful graphical widgets. Chapter 10 is on TclX, also known as Extended Tel, a number of extensions that make Tcl more suited to general-purpose programming. Chapter 11 is on BLT, which provides a number of useful new commands for producing graphs, managing data, and performing other graphics-related functions.
Tcl has good support for relational databases. Chapter 12 and Chapter 13 cover the Tcl extensions for the popular Oracle and Sybase relational databases, and Chapter 14 describes Tclodbc, which supports the Microsoft Windows ODBC database protocol.
Chapter 15, Hints and Tips for the Tcl Programmer, by Tom Poindexter, departs from the style of the rest of the book somewhat by presenting a collection of tips for using Tcl effectively, commonly made errors, and suggestions on programming style.
The Appendix, Tcl Resources, lists further resources on Tcl, both in print and on the Internet. The index cross-references the material in the book, including every Tcl command described in the text.