| |  | Copyright |
| |  | List of Examples |
| |  | List of Tables |
| |  | Preface |
| |
|  | Why Tcl? |
| |
|  | Tcl and Tk Versions |
| |
|  | Who Should Read This Book |
| |
|  | How to Read This Book |
| |
|  | Other Tcl Books |
| |
|  | On-line Examples |
| |
|  | Ftp Archives |
| |
|  | World Wide Web |
| |
|  | Newsgroups |
| |
|  | Typographic Conventions |
| |
|  | Hot Tips |
| |
|  | Book Organization |
| |
|  | What's New in the Third Edition |
| |
|  | First Edition Thanks |
| |
|  | Second Edition Thanks |
| |
|  | Third Edition Thanks |
| |
|  | Contact the Author |
|
| |  | Part I.
Tcl Basics |
| |
|  | Chapter 1.
Tcl Fundamentals |
| |
|  | Tcl Commands |
| |
|  | Hello, World! |
| |
|  | Variables |
| |
|  | Command Substitution |
| |
|  | Math Expressions |
| |
|  | Backslash Substitution |
| |
|  | Grouping with Braces and Double Quotes |
| |
|  | Procedures |
| |
|  | A Factorial Example |
| |
|  | More about Variables |
| |
|  | More about Math Expressions |
| |
|  | Comments |
| |
|  | Substitution and Grouping Summary |
| |
|  | Fine Points |
| |
|  | Reference |
|
| |
|  | Chapter 2.
Getting Started |
| |
|  | The source Command |
| |
|  | UNIX Tcl Scripts |
| |
|  | Windows 95 Start Menu |
| |
|  | The Macintosh and ResEdit |
| |
|  | The console Command |
| |
|  | Command-Line Arguments |
| |
|  | Predefined Variables |
|
| |
|  | Chapter 3.
The Guestbook CGI Application |
| |
|  | A Quick Introduction to HTML |
| |
|  | CGI for Dynamic Pages |
| |
|  | The guestbook.cgi Script |
| |
|  | Defining Forms and Processing Form Data |
| |
|  | The cgi.tcl Package |
| |
|  | Next Steps |
|
| |
|  | Chapter 4.
String Processing in Tcl |
| |
|  | The string Command |
| |
|  | The append Command |
| |
|  | The format Command |
| |
|  | The scan Command |
| |
|  | The binary Command |
| |
|  | Related Chapters |
|
| |
|  | Chapter 5.
Tcl Lists |
| |
|  | Tcl Lists |
| |
|  | Constructing Lists |
| |
|  | Getting List Elements: llength, lindex, and lrange |
| |
|  | Modifying Lists: linsert and lreplace |
| |
|  | Searching Lists: lsearch |
| |
|  | Sorting Lists: lsort |
| |
|  | The split Command |
| |
|  | The join Command |
| |
|  | Related Chapters |
|
| |
|  | Chapter 6.
Control Structure Commands |
| |
|  | If Then Else |
| |
|  | Switch |
| |
|  | While |
| |
|  | Foreach |
| |
|  | For |
| |
|  | Break and Continue |
| |
|  | Catch |
| |
|  | Error |
| |
|  | Return |
|
| |
|  | Chapter 7.
Procedures and Scope |
| |
|  | The proc Command |
| |
|  | Changing Command Names with rename |
| |
|  | Scope |
| |
|  | The global Command |
| |
|  | Call by Name Using upvar |
| |
|  | Variable Aliases with upvar |
|
| |
|  | Chapter 8.
Tcl Arrays |
| |
|  | Array Syntax |
| |
|  | The array Command |
| |
|  | Building Data Structures with Arrays |
|
| |
|  | Chapter 9.
Working with Files and Programs |
| |
|  | Running Programs with exec |
| |
|  | The file Command |
| |
|  | Cross-Platform File Naming |
| |
|  | Manipulating Files and Directories |
| |
|  | File Attributes |
| |
|  | Input/Output Command Summary |
| |
|  | Opening Files for I/O |
| |
|  | Reading and Writing |
| |
|  | The Current Directory ?cd and pwd |
| |
|  | Matching File Names with glob |
| |
|  | The exit and pid Commands |
| |
|  | Environment Variables |
| |
|  | The registry Command |
|
|
| |  | Part II.
Advanced Tcl |
| |
|  | Chapter 10.
Quoting Issues and Eval |
| |
|  | Constructing Code with the list Command |
| |
|  | Exploiting the concat inside eval |
| |
|  | The uplevel Command |
| |
|  | The subst Command |
|
| |
|  | Chapter 11.
Regular Expressions |
| |
|  | When to Use Regular Expressions |
| |
|  | Regular Expression Syntax |
| |
|  | Advanced Regular Expressions |
| |
|  | Syntax Summary |
| |
|  | The regexp Command |
| |
|  | The regsub Command |
| |
|  | Transforming Data to Program with regsub |
| |
|  | Other Commands That Use Regular Expressions |
|
| |
|  | Chapter 12.
Script Libraries and Packages |
| |
|  | Locating Packages: The auto_path Variable |
| |
|  | Using Packages |
| |
|  | Summary of Package Loading |
| |
|  | The package Command |
| |
|  | Libraries Based on the tclIndex File |
| |
|  | The unknown Command |
| |
|  | Interactive Conveniences |
| |
|  | Tcl Shell Library Environment |
| |
|  | Coding Style |
|
| |
|  | Chapter 13.
Reflection and Debugging |
| |
|  | The clock Command |
| |
|  | The info Command |
| |
|  | Cross-Platform Support |
| |
|  | Tracing Variable Values |
| |
|  | Interactive Command History |
| |
|  | Debugging |
| |
|  | Scriptics' TclPro |
| |
|  | Other Tools |
| |
|  | Performance Tuning |
|
| |
|  | Chapter 14.
Namespaces |
| |
|  | Using Namespaces |
| |
|  | Namespace Variables |
| |
|  | Command Lookup |
| |
|  | Nested Namespaces |
| |
|  | Importing and Exporting Procedures |
| |
|  | Callbacks and Namespaces |
| |
|  | Introspection |
| |
|  | The namespace Command |
| |
|  | Converting Existing Packages to use Namespaces |
| |
|  | [incr Tcl] Object System |
| |
|  | Notes |
|
| |
|  | Chapter 15.
Internationalization |
| |
|  | Character Sets and Encodings |
| |
|  | Message Catalogs |
|
| |
|  | Chapter 16.
Event-Driven Programming |
| |
|  | The Tcl Event Loop |
| |
|  | The after Command |
| |
|  | The fileevent Command |
| |
|  | The vwait Command |
| |
|  | The fconfigure Command |
|
| |
|  | Chapter 17.
Socket Programming |
| |
|  | Client Sockets |
| |
|  | Server Sockets |
| |
|  | The Echo Service |
| |
|  | Fetching a URL with HTTP |
| |
|  | The http Package |
| |
|  | Basic Authentication |
|
| |
|  | Chapter 18.
TclHttpd Web Server |
| |
|  | Integrating TclHttpd with your Application |
| |
|  | Domain Handlers |
| |
|  | Application Direct URLs |
| |
|  | Document Types |
| |
|  | HTML + Tcl Templates |
| |
|  | Form Handlers |
| |
|  | Programming Reference |
| |
|  | Standard Application-Direct URLs |
| |
|  | The TclHttpd Distribution |
| |
|  | Server Configuration |
|
| |
|  | Chapter 19.
Multiple Interpreters and Safe-Tcl |
| |
|  | The interp Command |
| |
|  | Creating Interpreters |
| |
|  | Safe Interpreters |
| |
|  | Command Aliases |
| |
|  | Hidden Commands |
| |
|  | Substitutions |
| |
|  | I/O from Safe Interpreters |
| |
|  | The Safe Base |
| |
|  | Security Policies |
|
| |
|  | Chapter 20.
Safe-Tk and the Browser Plugin |
| |
|  | Tk in Child Interpreters |
| |
|  | The Browser Plugin |
| |
|  | Security Policies and Browser Plugin |
| |
|  | Configuring Security Policies |
|
|
| |  | Part III.
Tk Basics |
| |
|  | Chapter 21.
Tk Fundamentals |
| |
|  | Hello, World! in Tk |
| |
|  | Naming Tk Widgets |
| |
|  | Configuring Tk Widgets |
| |
|  | Tk Widget Attributes and the Resource Database |
| |
|  | Summary of the Tk Commands |
|
| |
|  | Chapter 22.
Tk by Example |
| |
|  | ExecLog |
| |
|  | The Example Browser |
| |
|  | A Tcl Shell |
|
| |
|  | Chapter 23.
The Pack Geometry Manager |
| |
|  | Packing toward a Side |
| |
|  | Horizontal and Vertical Stacking |
| |
|  | The Cavity Model |
| |
|  | Packing Space and Display Space |
| |
|  | Resizing and -expand |
| |
|  | Anchoring |
| |
|  | Packing Order |
| |
|  | Choosing the Parent for Packing |
| |
|  | Unpacking a Widget |
| |
|  | Packer Summary |
| |
|  | Window Stacking Order |
|
| |
|  | Chapter 24.
The Grid Geometry Manager |
| |
|  | A Basic Grid |
| |
|  | Spanning Rows and Columns |
| |
|  | Row and Column Constraints |
| |
|  | The grid Command |
|
| |
|  | Chapter 25.
The Place Geometry Managery |
| |
|  | place Basics |
| |
|  | The Pane Manager |
| |
|  | The place Command |
|
| |
|  | Chapter 26.
Binding Commands to Events |
| |
|  | The bind Command |
| |
|  | The bindtags Command |
| |
|  | Event Syntax |
| |
|  | Modifiers |
| |
|  | Event Sequences |
| |
|  | Virtual Events |
| |
|  | Event Keywords |
|
|
| |  | Part IV.
Tk Widgets |
| |
|  | Chapter 27.
Buttons and Menus |
| |
|  | Button Commands and Scope Issues |
| |
|  | Buttons Associated with Tcl Variables |
| |
|  | Button Attributes |
| |
|  | Button Operations |
| |
|  | Menus and Menubuttons |
| |
|  | Keyboard Traversal |
| |
|  | Manipulating Menus and Menu Entries |
| |
|  | Menu Attributes |
| |
|  | A Menu by Name Package |
|
| |
|  | Chapter 28.
The Resource Database |
| |
|  | An Introduction to Resources |
| |
|  | Loading Option Database Files |
| |
|  | Adding Individual Database Entries |
| |
|  | Accessing the Database |
| |
|  | User-Defined Buttons |
| |
|  | User-Defined Menus |
|
| |
|  | Chapter 29.
Simple Tk Widgets |
| |
|  | Frames and Toplevel Windows |
| |
|  | The Label Widget |
| |
|  | The Message Widget |
| |
|  | The Scale Widget |
| |
|  | The bell Command |
|
| |
|  | Chapter 30.
Scrollbars |
| |
|  | Using Scrollbars |
| |
|  | The Scrollbar Protocol |
| |
|  | The Scrollbar Widget |
|
| |
|  | Chapter 31.
The Entry Widget |
| |
|  | Using Entry Widgets |
| |
|  | The Entry Widget |
|
| |
|  | Chapter 32.
The Listbox Widget |
| |
|  | Using Listboxes |
| |
|  | Listbox Bindings |
| |
|  | Listbox Attributes |
|
| |
|  | Chapter 33.
The Text Widget |
| |
|  | Text Indices |
| |
|  | Text Marks |
| |
|  | Text Tags |
| |
|  | The Selection |
| |
|  | Tag Bindings |
| |
|  | Searching Text |
| |
|  | Embedded Widgets |
| |
|  | Embedded Images |
| |
|  | Looking inside the Text Widget |
| |
|  | Text Bindings |
| |
|  | Text Operations |
| |
|  | Text Attributes |
|
| |
|  | Chapter 34.
The Canvas Widget |
| |
|  | Canvas Coordinates |
| |
|  | Hello, World! |
| |
|  | The Min Max Scale Example |
| |
|  | Canvas Objects |
| |
|  | Canvas Operations |
| |
|  | Generating Postscript |
| |
|  | Canvas Attributes |
| |
|  | Hints |
|
|
| |  | Part V.
Tk Details |
| |
|  | Chapter 35.
Selections and the Clipboard |
| |
|  | The Selection Model |
| |
|  | The selection Command |
| |
|  | The clipboard Command |
| |
|  | Selection Handlers |
|
| |
|  | Chapter 36.
Focus, Grabs, and Dialogs |
| |
|  | Standard Dialogs |
| |
|  | Custom Dialogs |
| |
|  | Animation with the update Command |
|
| |
|  | Chapter 37.
Tk Widget Attributes |
| |
|  | Configuring Attributes |
| |
|  | Size |
| |
|  | Borders and Relief |
| |
|  | The Focus Highlight |
| |
|  | Padding and Anchors |
|
| |
|  | Chapter 38.
Color, Images, and Cursors |
| |
|  | Colors |
| |
|  | Colormaps and Visuals |
| |
|  | Bitmaps and Images |
| |
|  | The Text Insert Cursor |
| |
|  | The Mouse Cursor |
|
| |
|  | Chapter 39.
Fonts and Text Attributes |
| |
|  | Naming a Font |
| |
|  | X Font Names |
| |
|  | Font Metrics |
| |
|  | The font Command |
| |
|  | Text Attributes |
| |
|  | Gridding, Resizing, and Geometry |
| |
|  | A Font Selection Application |
|
| |
|  | Chapter 40.
Send |
| |
|  | The send Command |
| |
|  | The Sender Script |
| |
|  | Communicating Processes |
| |
|  | Remote eval through Sockets |
|
| |
|  | Chapter 41.
Window Managers and Window Information |
| |
|  | The wm Command |
| |
|  | The winfo Command |
| |
|  | The tk Command |
|
| |
|  | Chapter 42.
Managing User Preferences |
| |
|  | App-Defaults Files |
| |
|  | Defining Preferences |
| |
|  | The Preferences User Interface |
| |
|  | Managing the Preferences File |
| |
|  | Tracing Changes to Preference Variables |
| |
|  | Improving the Package |
|
| |
|  | Chapter 43.
A User Interface to Bindings |
| |
|  | A Pair of Listboxes Working Together |
| |
|  | The Editing Interface |
| |
|  | Saving and Loading Bindings |
|
|
| |  | Part VI.
C Programming |
| |
|  | Chapter 44.
C Programming and Tcl |
| |
|  | Basic Concepts |
| |
|  | Creating a Loadable Package |
| |
|  | A C Command Procedure |
| |
|  | The blob Command Example |
| |
|  | Strings and Internationalization |
| |
|  | Tcl_Main and Tcl_AppInit |
| |
|  | The Event Loop |
| |
|  | Invoking Scripts from C |
|
| |
|  | Chapter 45.
Compiling Tcl and Extensions |
| |
|  | Standard Directory Structure |
| |
|  | Building Tcl from Source |
| |
|  | Using Stub Libraries |
| |
|  | Using autoconf |
| |
|  | The Sample Extension |
|
| |
|  | Chapter 46.
Writing a Tk Widget in C |
| |
|  | Initializing the Extension |
| |
|  | The Widget Data Structure |
| |
|  | The Widget Class Command |
| |
|  | The Widget Instance Command |
| |
|  | Configuring and Reconfiguring Attributes |
| |
|  | Specifying Widget Attributes |
| |
|  | Displaying the Clock |
| |
|  | The Window Event Procedure |
| |
|  | Final Cleanup |
|
| |
|  | Chapter 47.
C Library Overview |
| |
|  | An Overview of the Tcl C Library |
| |
|  | An Overview of the Tk C Library |
|
|
| |  | Part VII.
Changes |
| |
|  | Chapter 48.
Tcl 7.4/Tk 4.0 |
| |
|  | wish |
| |
|  | Obsolete Features |
| |
|  | The cget Operation |
| |
|  | Input Focus Highlight |
| |
|  | Bindings |
| |
|  | Scrollbar Interface |
| |
|  | pack info |
| |
|  | Focus |
| |
|  | The send Command |
| |
|  | Internal Button Padding |
| |
|  | Radiobutton Value |
| |
|  | Entry Widget |
| |
|  | Menus |
| |
|  | Listboxes |
| |
|  | No geometry Attribute |
| |
|  | Text Widget |
| |
|  | Color Attributes |
| |
|  | Color Allocation and tk colormodel |
| |
|  | Canvas scrollincrement |
| |
|  | The Selection |
| |
|  | The bell Command |
|
| |
|  | Chapter 49.
Tcl 7.5/Tk 4.1 |
| |
|  | Cross-Platform Scripts |
| |
|  | The clock Command |
| |
|  | The load Command |
| |
|  | The package Command |
| |
|  | Multiple foreach loop variables |
| |
|  | Event Loop Moves from Tk to Tcl |
| |
|  | Network Sockets |
| |
|  | Multiple Interpreters and Safe-Tcl |
| |
|  | The grid Geometry Manager |
| |
|  | The Text Widget |
| |
|  | The Entry Widget |
|
| |
|  | Chapter 50.
Tcl 7.6/Tk 4.2 |
| |
|  | More file Operations |
| |
|  | Virtual Events |
| |
|  | Standard Dialogs |
| |
|  | New grid Geometry Manager |
| |
|  | Macintosh unsupported1 Command |
|
| |
|  | Chapter 51.
Tcl/Tk 8.0 |
| |
|  | The Tcl Compiler |
| |
|  | Namespaces |
| |
|  | Safe-Tcl |
| |
|  | New lsort |
| |
|  | tcl_precision Variable |
| |
|  | Year 2000 Convention |
| |
|  | Http Package |
| |
|  | Serial Line I/O |
| |
|  | Platform-Independent Fonts |
| |
|  | The tk scaling Command |
| |
|  | Application Embedding |
| |
|  | Native Menus and Menubars |
| |
|  | CDE Border Width |
| |
|  | Native Buttons and Scrollbars |
| |
|  | Images in Text Widgets |
| |
|  | No Errors from destroy |
| |
|  | grid rowconfigure |
| |
|  | The Patch Releases |
|
| |
|  | Chapter 52.
Tcl/Tk 8.1 |
| |
|  | Unicode and Internationalization |
| |
|  | Thread Safety |
| |
|  | Advanced Regular Expressions |
| |
|  | New String Commands |
| |
|  | The DDE Extension |
| |
|  | Miscellaneous |
|
| |
|  | Chapter 53.
Tcl/Tk 8.2 |
| |
|  | The Trf Patch |
| |
|  | Faster String Operations |
| |
|  | Empty Array Names |
| |
|  | Brower Plugin Compatiblity |
|
| |
|  | Chapter 54.
Tcl/Tk 8.3 |
| |
|  | Proposed Tcl Changes |
| |
|  | Proposed Tk Changes |
|
| |
|  | Chapter 55.
About The CD-ROM |
| |
|  | Technical Support |
|
|
| |  | Index |