×

Uh-oh, it looks like your Internet Explorer is out of date.

For a better shopping experience, please upgrade now.

Effective TCL/TK Programming: Writing Better Programs with TCL and TK / Edition 1
     

Effective TCL/TK Programming: Writing Better Programs with TCL and TK / Edition 1

by Mark Harrison
 

ISBN-10: 0201634740

ISBN-13: 9780201634747

Pub. Date: 11/28/1997

Publisher: Addison-Wesley

You need a graphical user interface, and it needs to run on multiple platforms. You don't have much time, and you're not a wizard with X/Motif, the Win32 GUI, or the Mac GUI. The project seems impossible, but with Tcl/Tk it's simple and fun.

The Tcl scripting language and the Tk toolkit create a powerful programming environment for building graphical user

Overview

You need a graphical user interface, and it needs to run on multiple platforms. You don't have much time, and you're not a wizard with X/Motif, the Win32 GUI, or the Mac GUI. The project seems impossible, but with Tcl/Tk it's simple and fun.

The Tcl scripting language and the Tk toolkit create a powerful programming environment for building graphical user interfaces. With two lines of code you can create a simple button; with two hundred lines of code, a desktop calculator; and with a thousand lines of code, an industrial-strength groupware calendar and appointment minder. Your applications run on all of the major platforms: UNIX, Windows 95/NT, and Macintosh. You can even embed your programs in a Web page to make them available online.

Mark Harrison and Michael McLennan, two noted Tcl/Tk experts, combine their extensive experience in this practical programming guide. It is ideal for developers who are acquainted with the basics of Tcl/Tk and are now moving on to build real applications.

Effective Tcl/Tk Programming shows you how to build Tcl/Tk applications effectively and efficiently through plenty of real-world advice. It clarifies some of the more powerful aspects of Tcl/Tk, such as the packer, the canvas widget, and binding tags. The authors describe valuable design strategies and coding techniques that will make your Tcl/Tk projects successful. You will learn how to:

  • Create interactive displays with the canvas widget
  • Create customized editors with the text widget
  • Create new geometry managers, like tabbed notebooks or paned windows
  • Implement client/server architectures
  • Handle data structures
  • Interface with existing applications
  • Package Tcl/Tk code into reusable libraries
  • Deliver Tcl/Tk applications that are easy to configure and install
  • Embed applications in a Web page
  • Build applications that will run on multiple platforms

Throughout the book, the authors develop numerous applications and a library of reusable components. Learn from their approach, follow their strategies, and steal their code for your own applications! But don't bother retyping all of the examples.

0201634740B04062001

Product Details

ISBN-13:
9780201634747
Publisher:
Addison-Wesley
Publication date:
11/28/1997
Series:
Addison-Wesley Professional Computing Series
Edition description:
New Edition
Pages:
432
Product dimensions:
7.30(w) x 9.10(h) x 1.10(d)

Table of Contents

Preface xiii
Chapter 1 Building Tcl/Tk Applications
1(14)
1.1 Application-building process
1(2)
1.2 A small application
3(12)
1.2.1 Designing the application
3(1)
1.2.2 Designing the screen
4(1)
1.2.3 Prototyping the screen
5(1)
1.2.4 Library analysis
6(2)
1.2.5 Adding behavior to the program
8(2)
1.2.6 Adding finishing touches
10(1)
1.2.7 Testing the program
11(2)
1.2.8 Packaging the program
13(2)
Chapter 2 Packing, Gridding, and Placing Windows
15(40)
2.1 Using the pack command
16(21)
2.1.1 Cavity-based model
16(1)
2.1.2 Packing options
17(3)
2.1.3 Packing order
20(1)
2.1.4 Hierarchical packing
20(4)
2.1.5 Compressing windows
24(2)
2.1.6 Enlarging windows
26(4)
2.1.7 Unpacking widgets
30(7)
2.2 Using the grid command
37(10)
2.2.1 Grid-based model
37(1)
2.2.2 Gridding options
38(4)
2.2.3 Resizing windows
42(2)
2.2.4 Mixing grid and pack
44(3)
2.3 Using the place command
47(8)
2.3.1 Coordinate-based model
47(1)
2.3.2 Custom geometry managers
48(7)
Chapter 3 Handling Events
55(54)
3.1 The event loop
55(13)
3.1.1 Keyboard focus
57(1)
3.1.2 Forcing updates
58(2)
3.1.3 Handling long-running bindings
60(6)
3.1.4 Execution scope
66(1)
3.1.5 Quoting and the event loop
66(2)
3.2 Simple examples using bind
68(3)
3.2.1 Selecting an item from a listbox
69(1)
3.2.2 Automatic button help
69(2)
3.2.3 Class bindings
71(1)
3.3 Syntax of the bind command
71(10)
3.3.1 The event specification
72(7)
3.3.2 Percent substitutions
79(2)
3.4 More complex events
81(7)
3.4.1 Click, drag, drop
81(4)
3.4.2 Customizing widget behavior
85(3)
3.5 Binding tags
88(8)
3.5.1 Default binding tags
90(1)
3.5.2 Using break to interrupt event processing
90(1)
3.5.3 Inventing binding tags for groups of bindings
91(3)
3.5.4 Binding to a top-level window
94(2)
3.6 Debugging bindings
96(3)
3.6.1 Displaying bindings
96(1)
3.6.2 Monitoring events
97(2)
3.7 Animation
99(10)
3.7.1 Animating items on a canvas
100(2)
3.7.2 Debugging after events
102(2)
3.7.3 Library procedures for animation
104(5)
Chapter 4 Using the Canvas Widget
109(72)
4.1 Understanding the canvas widget
110(11)
4.1.1 Scrolling
112(2)
4.1.2 Display list model
114(3)
4.1.3 Using tags
117(1)
4.1.4 Canvas bindings
118(3)
4.2 Scrollable form
121(4)
4.3 Progress gauge
125(3)
4.4 HSB color editor
128(7)
4.5 Tabbed notebook
135(7)
4.6 Calendar
142(15)
4.6.1 Handling size changes
142(7)
4.6.2 Sensors and callbacks
149(4)
4.6.3 Monitoring variables
153(4)
4.7 Simple drawing package
157(24)
4.7.1 Drawing items
158(2)
4.7.2 Selecting items
160(5)
4.7.3 Moving and deleting items
165(1)
4.7.4 Configuring items
166(2)
4.7.5 Resizing items
168(1)
4.7.6 Entering text
169(3)
4.7.7 Printing a drawing
172(1)
4.7.8 Saving a drawing
173(5)
4.7.9 Loading a drawing
178(3)
Chapter 5 Using the Text Widget
181(52)
5.1 Understanding the text widget
182(15)
5.1.1 Indexing model
182(4)
5.1.2 Scrolling
186(1)
5.1.3 Using tags
187(3)
5.1.4 Text bindings
190(3)
5.1.5 Using marks
193(1)
5.1.6 Wrap modes
194(1)
5.1.7 Tab stops
195(2)
5.2 Simple text editor
197(2)
5.3 Read-only text display
199(4)
5.4 Appointment editor
203(14)
5.4.1 Using tags to apply styles
204(7)
5.4.2 Embedded windows
211(2)
5.4.3 Changing text bindings
213(3)
5.4.4 Retrieving appointments
216(1)
5.5 Hierarchical browser
217(16)
5.5.1 Hierarchical data
218(5)
5.5.2 Creating the hierarchical browser
223(3)
5.5.3 Using tags and marks
226(7)
Chapter 6 Top-level Windows
233(30)
6.1 Toplevel widgets
233(2)
6.2 Setting the widget class
235(1)
6.3 Communicating with the window manager
235(3)
6.3.1 Window placement
236(1)
6.3.2 Window size
237(1)
6.4 Simple dialogs
238(4)
6.5 Modal dialogs
242(4)
6.6 Controlling access to dialogs
246(8)
6.6.1 Create/destroy strategy
246(2)
6.6.2 Help from the window manager
248(1)
6.6.3 Show/hide strategy
249(5)
6.7 Unmanaged windows
254(9)
6.7.1 Introductory placard
254(2)
6.7.2 Balloon help
256(7)
Chapter 7 Interacting with Other Programs
263(54)
7.1 Executing other programs
263(5)
7.1.1 Execution pipelines
265(1)
7.1.2 Building commands and handling errors
266(2)
7.2 Collecting output from long-running programs
268(3)
7.3 Driving other programs without temporary files
271(2)
7.4 Working around buffering problems
273(3)
7.4.1 Seeing the problem
273(1)
7.4.2 Fixing the problem
274(2)
7.5 Bidirectional pipes
276(3)
7.5.1 Buffering problems
276(1)
7.5.2 Writing and reading
277(1)
7.5.3 Graphical interface
278(1)
7.6 Client server architectures
279(23)
7.6.1 Advantages
279(1)
7.6.2 Disadvantages
280(1)
7.6.3 A simple server
281(2)
7.6.4 A simple client
283(2)
7.6.5 Smarter parsing
285(1)
7.6.6 Safer parsing
286(5)
7.6.7 Asynchronous communication
291(9)
7.6.8 Handling multiline requests
300(2)
7.7 Network programming with sockets
302(6)
7.7.1 Overview
303(1)
7.7.2 A networked server
304(2)
7.7.3 A networked client
306(2)
7.8 A case study--the Electric Secretary
308(9)
7.8.1 Downloading appointments from the server
309(2)
7.8.2 Sending an appointment to the server
311(1)
7.8.3 Handling schedule conflicts
312(1)
7.8.4 Preferences
312(3)
7.8.5 Persistent storage
315(1)
7.8.6 Conclusions
315(2)
Chapter 8 Delivering Tcl/Tk Applications
317(48)
8.1 Adding polish to your application
318(12)
8.1.1 Handling widget resources
318(6)
8.1.2 Handling unexpected errors
324(3)
8.1.3 Animated placard
327(3)
8.2 Creating Tcl/Tk libraries
330(16)
8.2.1 Designing library components
330(4)
8.2.2 Synthesizing data structures
334(3)
8.2.3 Adding callbacks to components
337(4)
8.2.4 Autoloading
341(2)
8.2.5 Packages
343(3)
8.3 Desktop applications
346(9)
8.3.1 Creating a distribution
346(2)
8.3.2 Making scripts into executable programs
348(2)
8.3.3 Making a self-installing program
350(5)
8.4 Web-based applications
355(10)
8.4.1 Simple example
355(3)
8.4.2 A few important caveats
358(4)
8.4.3 Security policies
362(3)
Chapter 9 Developing Cross-platform Applications
365(24)
9.1 User interface issues
366(14)
9.1.1 Menu bars
366(2)
9.1.2 Common dialogs
368(6)
9.1.3 Virtual events
374(1)
9.1.4 Fonts
375(4)
9.1.5 Option database
379(1)
9.2 File system issues
380(4)
9.2.1 File names
381(2)
9.2.2 File manipulation
383(1)
9.2.3 End-of-line translations
383(1)
9.3 Program invocation issues
384(3)
9.3.1 Communicating with other programs
384(2)
9.3.2 Environment variables
386(1)
9.4 When all else fails
387(2)
Appendix A Getting Started with Tcl/Tk 389(4)
A.1 Installing on Windows 95 NT 389(1)
A.2 Installing on UNIX 390(2)
A.3 Installing on Macintosh 392(1)
Appendix B Annotated Bibliography 393(2)
Index 395

Customer Reviews

Average Review:

Post to your social network

     

Most Helpful Customer Reviews

See all customer reviews