Tcl/Tk in a Nutshell

Book description

The Tcl language and Tk graphical toolkit are simple and powerful building blocks for custom applications. The Tcl/Tk combination is increasingly popular because it lets you produce sophisticated graphical interfaces with a few easy commands, develop and change scripts quickly, and conveniently tie together existing utilities or programming libraries.One of the attractive features of Tcl/Tk is the wide variety of commands, many offering a wealth of options. Most of the things you'd like to do have been anticipated by the language's creator, John Ousterhout, or one of the developers of Tcl/Tk's many powerful extensions. Thus, you'll find that a command or option probably exists to provide just what you need.And that's why it's valuable to have a quick reference that briefly describes every command and option in the core Tcl/Tk distribution as well as the most popular extensions. Keep this book on your desk as you write scripts, and you'll be able to find almost instantly the particular option you need.Most chapters consist of alphabetical listings. Since Tk and mega-widget packages break down commands by widget, the chapters on these topics are organized by widget along with a section of core commands where appropriate. Contents include:

  • Core Tcl and Tk commands and Tk widgets
  • C interface (prototypes)
  • Expect
  • [incr Tcl] and [incr Tk]
  • Tix
  • TclX
  • BLT
  • Oratcl, SybTcl, and Tclodbc

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Conventions
    2. Contact O’Reilly & Associates
    3. About This Book
    4. Acknowledgments
  2. 1. Introduction
    1. What Is Tcl?
    2. Structure of This Book
  3. 2. Tcl Core Commands
    1. Overview
    2. Basic Language Features
    3. Command-Line Options
    4. Environment Variables
    5. Special Variables
    6. Backslash Substitutions
    7. Operators and Math Functions
    8. Regular Expressions
    9. Pattern Globbing
    10. Predefined I/O Channel Identifiers
    11. Group Listing of Commands
      1. Control Statements
      2. File Manipulation
      3. Tcl Interpreter Information
      4. Lists
      5. Arrays
      6. Strings
      7. Input/Output
      8. System Interaction
      9. Command History
      10. Multiple Interpreters
      11. Packages
      12. Miscellaneous Commands
    12. Alphabetical Summary of Commands
  4. 3. Tk Core Commands
    1. Example
    2. Command-Line Options
    3. Environment Variable
    4. Special Variables
    5. Group Listing of Tk Commands
      1. Widgets
      2. Geometry Management
      3. Event Handling
      4. Focus
      5. Dialogs
      6. Miscellaneous
    6. Widget Overview
      1. Standard Widget Options
    7. Widget Commands
    8. Utility Commands
  5. 4. The Tcl C Interface
    1. Constants
    2. Data Types
    3. Group Listing of Functions
      1. Tcl Objects
      2. Interpreters and Script Evaluation
      3. Creating New Tcl Commands
      4. Initialization and Packages
      5. Parsing
      6. Exceptions
      7. Accessing Tcl Variables
      8. Hash Tables
      9. String Utilities
      10. POSIX Utilities
      11. Input/Output
      12. Notifier and Events
      13. Miscellaneous
    4. Alphabetical Summary of Functions
  6. 5. The Tk C Interface
    1. Constants
    2. Data Types
    3. Group Listing of Functions
      1. Windows
      2. Configuring Widgets
      3. Bitmaps and Photo Images
      4. Events
      5. Displaying Widgets
      6. Canvases
      7. Text
      8. The Selection
      9. Geometry Management
      10. Application Startup and Initialization
      11. Error Handling
      12. Color
      13. Cursors
      14. Miscellaneous
    4. Alphabetical Summary of Functions
  7. 6. Expect
    1. Overview
    2. Example
    3. Command-Line Options
    4. Environment Variables
    5. Special Variables
    6. Grouped Summary of Commands
      1. Process Interaction
      2. Utility Commands
      3. Synonyms
    7. Alphabetical Summary of Commands
  8. 7. [incr Tcl]
    1. Basic Class Definition
    2. Special Variables
    3. Group Listing of Commands
      1. Classes
      2. Objects
      3. Miscellaneous
    4. Example
    5. Alphabetical Summary of Commands
  9. 8. [incr Tk]
    1. Basic Structure of a Mega-widget
    2. Special Variable
    3. Methods and Variables
      1. Public Methods
      2. Protected Methods
      3. Protected Variables
    4. Alphabetical Summary of Commands
  10. 9. Tix
    1. Tix Overview
    2. Special Variables
    3. Group Listing of Tix Commands
      1. Mega-widgets
      2. Standard Widgets
      3. Core Commands
    4. Tix Mega-widget Overview
    5. Tix Mega-widgets
    6. Tix Standard Widgets Overview
      1. Display Items
        1. Image Items
        2. Imagetext Items
        3. Text Items
        4. Window Items
    7. Tix Standard Widgets
    8. Tix Core Commands
    9. Tix Extensions to Tk image Command
  11. 10. TclX
    1. Special Variables
    2. Group Listing of Commands
      1. General Commands
      2. Debugging and Development Commands
      3. Unix Access Commands
      4. File Commands
      5. File Scanning Commands
      6. Math Commands
      7. List Manipulation Commands
      8. Keyed List Commands
      9. String and Character Manipulation Commands
      10. XPG/3 Message Catalog Commands
      11. Help Commands
      12. Library and Package Commands
    3. Alphabetical Summary of Commands
  12. 11. BLT
    1. Environment Variable
    2. Special Variables
    3. Group Listing of Commands
      1. Graphical Commands
      2. Numerical Data Commands
      3. Tile Widget Commands
      4. Utility Commands
    4. Alphabetical Summary of Commands
  13. 12. Oratcl
    1. Overview
    2. Example
    3. Environment Variables
    4. Special Variables
    5. Group Listing of Commands
      1. Database Server Setup Commands
      2. Data Manipulation Commands
    6. Alphabetical Summary of Commands
  14. 13. Sybtcl
    1. Overview
    2. Example
    3. Environment Variables
    4. Special Variables
    5. Group Listing of Commands
      1. Database Server Setup Commands
      2. Data Manipulation Commands
    6. Alphabetical Summary of Commands
  15. 14. Tclodbc
    1. Overview
    2. Group Listing of Commands
      1. Connection and Configuration Commands
      2. Data Manipulation Commands
      3. Statement Commands
    3. Summary of Commands
  16. 15. Hints and Tips for the Tcl Programmer
    1. Think Commands, Not Statements
    2. Comments Are Treated as Commands
    3. A Symbolic Gesture
    4. Lists Are Strings, but Not All Strings Are Lists
    5. Indirect References
    6. Executing Other Programs
    7. When Is a Number Not a Number?
    8. Quoting and More Quoting
    9. Write Once, Run Where?
      1. Filenames and Pathnames
      2. End of Line Conventions
      3. Determining Platform Specifics
      4. Scanning and For matting Binary Data
    10. Common Tk Errors
      1. Global Scope for -variable and -textvariable
      2. The -command String Must Be a Tcl List
      3. Use update to Refresh Widgets and for Event Processing
    11. Use the Source, Luke!
  17. A. Tcl Resources
    1. Web Sites
      1. General
      2. Tcl/Tk Extensions
    2. Usenet Newsgroups
    3. Mailing Lists
  18. Index
  19. About the Authors
  20. Colophon
  21. Copyright

Product information

  • Title: Tcl/Tk in a Nutshell
  • Author(s): Paul Raines, Jeff Tranter
  • Release date: March 1999
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781565924338