Tcl/Tk for Programmers

With Solved Exercises that Work with Unix and Windows

J. Adrian Zimmer

Publisher: IEEE, 1998, 544 pages

ISBN: 0-8186-8515-8

Keywords: TCLTk

Last modified: March 6, 2022, 10:41 p.m.

This introduction to Tcl/Tk bridges the gaps between introductions, comprehensive manuals, and collections of scripts that solve particular problems. There are over 200 exercises with solutions that run on both Unix and Windows platforms.

Tcl/Tk for Programmers is an introduction to the high-level Tcl/Tk scripting language for experienced programmers with either a Unix or Windows background. The book includes a short introduction to TCP/IP, as well as longer introductions to writing client-side scripts and GUI interfaces, and integrating scripts with C/C++.

Tcl is a scripting language somewhat like Perl but extensible and clearer. Tk is an extension, developed by the creator of Tcl, used for creating scripts that interact with users through windows. After version 8.0/8.0, the unusually fast development of Tcl/Tk has slowed to a more normal pace. Tcl/Tk for Programmers covers this version while describing its major differences with the previous version 7.6/4.2 and the experimental alpha version 8.1/8.1 Zimmer has extensive knowledge of Tcl/Tk programming and currently runs a consulting and training company based on his experience.

    1. Getting Started
      1. Obtaining Tcl/Tk
      2. Interactive Execution
      3. Direct Execution
      4. Reading this Book
      5. Requirements for Networking Examples
      6. Requirements for the C/C++ Connection
      7. Tcl/Tk Version Requirements
  1. Tcl
    1. Basic Syntax and I/O
      1. The Form of a Tcl Script
      2. Variables in Tcl
      3. Copying a File Line by Line
      4. While Loop
      5. Curly Brackets
      6. Double Quotes
      7. Command Substitution
      8. Opening Files
      9. Completed File Copying Example
      10. More about Substitution
      11. Solutions to Exercises
    2. Expressions and Branching
      1. Expressions
      2. Branching
      3. Math Functions
      4. Solutions to Exercises
    3. Procedures
      1. Procedures
      2. Global and Local Variables
      3. Passing Arguments by Reference
      4. Default Values for Parameters
      5. Reimplementing Procedures
      6. Regional Variables
      7. Action Families
      8. An Example Action Family
      9. Implementing Action Families in Earlier Versions of Tcl
      10. Error Handling
      11. Procedures Defining Procedures
      12. Solutions to Exercises
    4. Data Structures and Iteration
      1. Associative Array and the Concept of Function
      2. Using Arrays for Missing Features
      3. Procedures for Working with Arrays
      4. The scan and format Procedures
      5. Lists
      6. An Action Family for Working with Lists
      7. Lists Support Flexible Argument Usage
      8. Switches and Options
      9. Iteration
      10. Indexing Web Sites
      11. Solutions to Exercises
    5. Strings, Files, and Glob Pattern Matching
      1. The string Action Family
      2. The file Action Family
      3. The info Action Family
      4. Glob Patterns
      5. Commands Accepting Glob Patterns
      6. Developing for Multiple Platforms
      7. A Virtual Machine
      8. Solutions to Exercises
    6. Regexp and Regsub
      1. Theory and Practice
      2. Character Set, Quoting, and Style
      3. Regular-Expression versus Glob Patterns
      4. Repetitions and Branches
      5. Use Parentheses to Build more Complicated Patterns
      6. Use Parentheses to Extract Subpatterns
      7. Search and Replace
      8. Style Review
      9. Solutions to Exercises
    7. Tcl Odds and Ends
      1. Starting Processes and Pipes
      2. More about I/O
      3. More about Variables
      4. The clock Action Family
      5. Building Command Lines
      6. Object Action Families
      7. Executing Scripts from within Scripts
      8. Interpreter Hierarchies
      9. Delaying Execution
      10. Performance Testing
      11. The Current Directory
      12. Binary Data
      13. Solutions to Exercises
    8. More about Procedures
      1. Packages and Automatically Sourcing Procedures
      2. Loading Procedures in Binary Form
      3. On Control Structures
      4. Example Control Structures
      5. Solutions to Exercises
    9. TCP/IP Networks and Event-Driven Programming
      1. TCP/IP Networks as Seen from Tcl
      2. The World Wide Web as a Client/Server Application
      3. Creating a Web Client in Tcl
      4. The Event Loop
      5. Timeouts
      6. Background Error Handling
      7. Client/Server the Tcl Way
      8. More about the Event Loop
      9. The http Package
      10. A Brief HTML Introduction
      11. Solutions to Exercises
  2. Tk
    1. Overview of Tk
      1. Starting with Tk
      2. The Tk Way of Thinking
      3. Details of the Caps Example
      4. Enhancing Caps with Tab
      5. Cleaning Up the Root Window
      6. Multiplatform Caveat
      7. Solutions to Exercises
    2. Widget Characteristics
      1. Focus
      2. Size
      3. Frames, the Archetypal, No-Frills Widgets
      4. Colors
      5. Fonts
      6. Mouse Cursor
      7. Common Options
      8. Solutions to Exercises
    3. Geometry Management
      1. The pack and grid Action Families
      2. Slicing
      3. Slicing for Size Changes
      4. Padding
      5. An Array of Cells
      6. The Cavity
      7. Placing Widgets more Carefully
      8. Tricks for Using Pack
      9. Solutions to Exercises
    4. Some Basic Widget Types
      1. Labels
      2. Buttons
      3. Entries
      4. Images
      5. Widget Padding
      6. Active/Normal/Disabled
      7. Selection
      8. Solutions to Exercises
    5. List of Widget Types
      1. Button
      2. Canvas
      3. Checkbutton
      4. Entry
      5. Frame
      6. Label
      7. Listbox
      8. Menu and Menubutton
      9. Message
      10. Radiobutton
      11. Scale
      12. Scrollbar
      13. Text
      14. Toplevel
      15. Exercises
      16. Solutions to Exercises
    6. Bindings.
      1. User Events
      2. Getting Information to Event Handlers
      3. Bindings
      4. More about Bindings
      5. Timing
      6. Solutions to Exercises
    7. Partially Displayed Widgets
      1. Listboxes
      2. Scrollbars
      3. Menus and Menubuttons
      4. Option Menus
      5. Solutions to Exercises
    8. Text Widgets
      1. A Multiline Entry Widget and More
      2. Marks and Indexing
      3. Text Tags
      4. Tag Subactions
      5. Tag Options
      6. Embedded Widgets
      7. Solutions to Exercises
    9. Canvases
      1. Introduction, Subwindows, and Scrolling
      2. Anchoring and Discrete Scrolling
      3. A Script for Examining Canvas Items
      4. The Oval is a Typical Item
      5. Canvas Tags
      6. A Tour of Canvas Items
      7. Changing Option Values
      8. Moving Items
      9. Identifying an Item or Tagged Set under the Mouse
      10. Canvas-Object Actions
      11. PostScript
      12. Implementing the Item Examining Script
      13. Solutions to Exercises
    10. Tk Odds and Ends
      1. The winfo Action Family
      2. The wm Action Family
      3. Cutting and Pasting
      4. Asserting Primacy among Windows
      5. A New Command Window
      6. Solutions to Exercises
    11. The Browser Plugin and Safe-Tcl
      1. The Tcl/Tk Plugin
      2. Combining Features into Policies
      3. Writing Tclets
      4. Customizing Slave Interpreters
      5. Safe-Tcl
      6. Solutions to Exercises
  3. C/C++
    1. The C/C++ Connection
      1. Data Types in Transition
      2. C Procedures that Run as Tcl/Tk Commands
      3. Naming Conventions
      4. Registering Commands
      5. Extending Tcl with the Recompile/Relink Method
      6. Extending Tcl with the Load Method
      7. Creating Math Functions
      8. Tk
      9. Solutions to Exercises
    2. Essential Library Functions
      1. Allocating Memory
      2. Manipulating Objects of Type Tcl_Obj
      3. More about Command Execution
      4. Accessing Tcl Variables
      5. List Processing
      6. Solutions to Exercises
    3. Some Useful Library Functions
      1. Checking Arguments
      2. Dynamic Strings
      3. Pattern Matching
      4. Associative Arrays
      5. Multiple Associative Arrays
      6. Solutions to Exercises
    4. Creating Tcl Objects in C/C++
      1. Object Orientation in C
      2. Object Orientation in Tcl
      3. Implementing Object Actions
      4. Implementing Class Actions
      5. Commands that Work with Multiple Objects
      6. Solutions to Exercises

Reviews

Tcl/Tk for Programmers

Reviewed by Roland Buresund

Good ******* (7 out of 10)

Last modified: Nov. 18, 2008, 1:49 p.m.

The title is true. Recommended.

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required