Willkommen, schön sind Sie da!
Logo Ex Libris

Tcl and the Tk Toolkit

  • Kartonierter Einband
  • 458 Seiten
(0) Erste Bewertung abgeben
Alle Bewertungen ansehen
John K. Ousterhout, a professor in the Department of Electrical Engineering and Computer Science at the University of California a... Weiterlesen
CHF 55.90
Auslieferung erfolgt in der Regel innert 2 bis 3 Wochen.
Bestellung & Lieferung in eine Filiale möglich



John K. Ousterhout, a professor in the Department of Electrical Engineering and Computer Science at the University of California at Berkeley, is the creator of Tcl and Tk. In addition to his work on Tcl and Tk, he is leading the development of a network operating system for high-performance workstations. He is a recipient of the ACM Grace Murray Hopper Award, among numerous other honors.



The Tcl scripting language and the Tk toolkit - a programming environment for creating graphical user interfaces under X Windows - together represent one of the most exciting innovations in X Window System programming. Because Tcl and Tk are so easy to learn, extremely powerful, and contain so many sophisticated features, they have dramatically reduced development time for thousands of X programmers.

Written by the creator of Tcl and Tk, this book is the single authoritative resource for anyone who wants to work with this extraordinary environment. The book offers an introduction and overview of Tcl and Tk and then presents detailed instructions for script writing in Tcl and working with the Tk toolkit.

You will discover how Tk's windowing shell, wish, enables you to develop window-based applications with amazingly few lines of code. You will also find information on Tk's novel and powerful facility for linking applications. Many other features are also described, such as Tk's hypertext and hypergraphics widgets and Tcl's facilities for procedures, list management, and subprocess execution.

For interested readers, the book also describes the C interfaces for Tcl and Tk, showing how to extend their built-in features by writing new C commands.

Upon reading this book, you will learn how to produce far more powerful X Windows System applications in a fraction of the time that used to be required.

"The main guide to Tcl is Tcl and the Tk Toolkit by John Ousterhout (Reading, MA: Addison-Wesley, 1994), the creator of Tcl."
- Unix Review

"The definitive source of information on the system is John Ousterhout's book, Tcl and the Tk Toolkit, published by Addison-Wesley."
- Linux Journal

"Overall, Ousterhout has provided an excellent overview (Tcl and the Tk Toolkit)of a very useful piece of software. If you're thinking of building or customizing a graphical user interface, you won't find many guides better than this."
- IEEE Computer

"This is an extremely well-written book, containing many figures, tables, examples, and scripts to illustrate the Tcl and Tk concepts. His presentation technique and expertise result in a superb text. I enjoyed Tcl and the Tk Toolkit and recommend it highly to anyone with any shell writing experience. Everyone who uses the X Window System will find this book helpful."
- Sys Admin


The Tcl scripting language and the Tk toolkit together represent one of the most exciting innovations in X Window System programming. This book offers an introduction and overview of Tcl and Tk and then presents detailed instructions for script writing in Tcl and working with the Tk toolkit.


1. Introduction.


Organization of the Book.




2. An Overview of Tcl and Tk.

Getting Started.

Hello World with Tk.

Script Files.

Variables and Substitutions.

Control Structures.

On the Tcl Language.

Event Bindings.


Additional Features of Tcl and Tk.

Extensions and Applications.


3. Tcl Language Syntax.

Scripts, Commands, and Words

Evaluating a Command.

Variable Substitution.

Command Substitution.

Backslash Substitution.

Quoting with Double Quotes.

Quoting With Braces.


Normal and Exceptional Returns.

More on Substitutions.

4. Variables.

Simple Variables and the Set Command.


Variable Substitution.

Removing Variables: Unset.

Multidimensional Arrays.

The Incr and Append Commands.

Predefined Variables.

Preview of Other Variable Facilities.

5. Expressions.

Numeric Operands.

Operators and Precedence.

Math Functions.


String Manipulation.

Types and Conversions.


6. Lists.

Basic List Structure and the Lindex Command.

Creating Lists: Concat, List, and Llength.

Modifying Lists: Linsert, Lreplace, Lrange, and Lappend.

Searching Lists: Lsearch.

Sorting Lists: Lsort.

Converting Between Strings and Lists: Split and Join.

Lists and Commands.

7. Control Flow.

The If Command.

Looping Commands: While, For, and Foreach.

Loop Control: Break and Continue.

The Switch Command.

The Eval Command.

Executing From Files: Source.

8. Procedures.

Procedure Basics: Proc and Return.

Local and Global Variables.

Defaults and Variable Numbers of Arguments.

Call By Reference: Upvar.

Creating New Control Structures: Uplevel.

9. String Manipulation.

Character Set Issues.

Glob-Style Pattern Matching.

Pattern Matching with Regular Expressions.

Using Regular Expressions for Substitutions.

Generating Strings with Format.

Parsing Strings With Scan.

Extracting Characters: String Index and String Range.

Searching and Comparison.

Length, Case Conversion, and Trimming.

10. Accessing Files.

File Names.

Basic File I/O.

Output Buffering.

Random Access to Files.

The Current Working Directory.

Manipulating File Names: Glob and File.

File Information Commands.

Errors in System Calls.

11. Processes.

Invoking Subprocesses with Exec.

I/O To and From a Command Pipeline.

Process Ids.

Environment Variables.

Terminating the Tcl Process with Exit.

12. Errors and Exceptions.

What Happens after an Error?

Generating Errors from Tcl Scripts.

Trapping Errors with Catch.

Exceptions in General.

13. Managing Tcl Internals.

Querying the Elements of an Array.

The Info Command.

Timing Command Execution.

Tracing Operations on Variables.

Renaming and Deleting Commands.

Unknown Commands.


14. History.

The History List.

Specifying Events1.

Reexecuting Commands from the History List.

Shortcuts Implemented by Unknown.

Current Event Number: History Nextid.


15. An Introduction to Tk.

A Brief Introduction to X.


Applications, Top-Level Widgets, and Screens.

Scripts and Events.

Creating and Destroying Widgets.

Geometry Managers.

Widget Commands.

Commands for Interconnection.

16. A Tour of the Tk Widgets.




Buttons, Checkbuttons, and Radiobuttons.






Menus and Menubuttons.

Other Common Options.

17. Geometry Managers: the Packer.

An Overview of Geometry Management.

Packer Basics.

The Pack Command and -Side Options.





Packing Order.

Hierarchical Packing.

Other Options to the Pack Command.

Other Geometry Managers in Tk.

18. Bindings.

X Events.

An Overview of the Bind Command.

Event Patterns.

Sequences of Events.

Substitutions in Scripts.

Conflict Resolution.

When are Events Processed?

Background Errors: Tkerror.

Other Uses of Bindings.

19. Canvas and Text Widgets.

Canvas Basics: Items and Types.

Manipulating Items with Identifiers and Tags.


Other Canvas Features.

Text Widgets.

Text Indices and Marks.

Text Tags.

20. The Selection.

Selections, Retrievals, and Targets.

Locating and Clearing the Selection.

Supplying the Selection with Tcl Scripts.

21. The Input Focus.

Focus Model: Explicit vs. Implicit.

Setting The Input Focus.

Clearing The Focus.

The Default Focus.


22. Window Managers.

Window Sizes.

Gridded Windows.

Window Positions.

Window States.


Window Manager Protocols.

Special Handling: Transients, Groups, and Override-Redirect.

Session Management.

A Warning about Window Managers.

23. The Send Command.



Application Names.

Security Issues.

24. Modal Interactions.


Keyboard Handling During Grabs.

Waiting: The Tkwait Command.

25. More on Configuration Options.

The Option Database.

Option Database Entries.

The RESOURCE_MANAGER Property and .Xdefaults File.

Priorities in the Option Database.

The Option Command.

The Configure Widget Command.

26. Odds and Ends.

Destroying Widgets.

Time Delays.

The Update Command.

Information about Widgets.

Raise and Lower.

The Tk Command: Color Models.

Variables Managed by Tk.

27. Examples.

A Procedure that Generates Dialog Boxes.

A Remote-Control Application.


28. Philosophy.

C vs. Tcl: Primitives.

Object Names.

Commands: Action-Oriented vs. Object-Oriented.

Representing Information.

29. Interpreters and Script Evaluation.


A Simple Tcl Application.

Other Evaluation Procedures.

Deleting Interpreters.

30. Creating New Tcl Commands.

Command Procedures.

Registering Commands.

The Result Protocol.

Procedures for Managing the Result.

Clientdata and Deletion Callbacks.

Deleting Commands.

How Tcl Procedures Work.

31. Tcl_AppInit and Packages.


Defining Packages.

32. Parsing.

Numbers and Booleans.

Expression Evaluation.

Manipulating Lists.

33. Exceptions.

Completion Codes.

Augmenting the Stack Trace in errorInfo.

Setting errorCode.

34. Accessing Tcl Variables.

Naming Variables.

Setting Variable Values.

Reading Variables.

Unsetting Variables.

Linking Tcl and C Variables.

Setting and Unsetting Variable Traces.

Trace Callbacks.

Whole-Array Traces.

Multiple Traces.

Unset Callbacks.

Nonexistent Variables.

Querying Trace Information.

35. Hash Tables.

Keys and Values.

Creating and Deleting Hash Tables.

Creating Entries.

Finding Existing Entries.


Deleting Entries.


36. String Utilities.

Dynamic Strings.

Command Completeness.

String Matching.

37. POSIX Utilities.

Tilde Expansion.

Generating Messages.

Creating Subprocesses.

Background Processes.


38. Introduction.

What's in a Widget?

The Relationship Between Tk and Xlib.

Square: An Example Widget.


Design for Reusability.

39. Creating Windows.

Windows and Tk_Windows.

Creating Tk_Windows.

Setting a Window's Class.

Deleting Windows.

Basic Operations on Tk_Windows.

Class Command Procedures.

Package Initialization.

Delayed Window Creation.

40. Configuring Widgets.


Resource Caches.


Other Translators.

Changing Window Attributes.

The Square Configure Procedure.

The Square Widget Command Procedure.

41. Events.

X Events.

File Events.

Timer Events.

Idle Callbacks.

Generic Event Handlers.

Invoking the Event Dispatcher.

42. Displaying Widgets.

Delayed Redisplay.

Double-Buffering with Pixmaps.

Drawing Procedures.

43. Destroying Widgets.


Delayed Cleanup.

44. Managing the Selection.

Selection Handlers.

Claiming the Selection.

Retrieving the Selection.

45. Geometry Management.

Requesting a Size for a Widget.

Internal Borders.


Geometry Managers.

Claiming Ownership.

Retrieving Geometry Information.

Mapping and Setting Geometry.

Writing Geometry Managers.

Appendix A. Installing Tcl and Tk.


The Master Directory.

Retrieving Distributions with FTP.

Retrieving Distributions with Electronic Mail.

Compiling and Installing the Distributions.

Contributed Extensions.

Comp.lang.tcl newsgroup.

Index. 020163337XT04062001


Titel: Tcl and the Tk Toolkit
EAN: 9780201633375
ISBN: 978-0-201-63337-5
Format: Kartonierter Einband
Herausgeber: Pearson Academic
Genre: Informatik
Anzahl Seiten: 458
Gewicht: 792g
Größe: H232mm x B188mm x T22mm
Jahr: 1994