This page reflects errors that were found in the first printing and fixed for the second printing. Of course, the day after I gave the fixes to the publisher I found more errors.
Last update Mon Jun 29 21:54:14 PDT 1998
cover | The URL on the back of the book is wrong! It should be http://www.beedub.com/ |
p19 | Missing rand() and srand(seed) math functions |
pp21-22 | Missing namespace, package, and variable commands |
pp23-24 | Should cross reference the CGI script from Chapter 3. |
p27 | Line-wrap bug at top of page. |
p28 | browser_args is changing (back) to embed_args. |
p28 | The browser_args variable was renamed embed_args to be compatible with the 1.0 version of the plugin. |
p33 | Line-wrap bug at bottom of page. |
p36 | Typo: "show" should be "shown" at bottom of page. |
p37 | Should reference Example 3-8 explicitly |
p41 | Added reference to Libes' cgi.tcl package |
p45 | Font error in "append is efficient" |
p51 | Font error in "@" at bottom of page |
p51 | The sentence at the bottom of the page should be "This command gets the second double-precision number." (not the third.) |
p52 | Should say "binary format", not "scan format" |
p52 | Reference to Chapter 47 is bogus. |
p54 | -glob switch broken across lines in Table 5-1. |
p67 | At end of page, should say "once for each element in the list" (not loop) |
p70 | Bad line break in Example 6-12 |
p88 | Should be "return $employeeManager($name)" in Example 8-5 |
p88 | Should be "return $employee(manager,$name)" in Example 8-6 |
p93 | Added reference to AppleScript documentation |
p99 | Delete extra reference to Table 9-3 |
p100 | -permissions file attribute can only be a number. The symbolic modes understood by the UNIX chmod program are not supported. |
p103 | Fixed reference to Exploring Expect, and removed "do" from "... powerful way to do interact ..." |
p106 | Font error on glob at bottom of page. |
p109 | I added a note about defining environment variables on the Macintosh
Note: Environment variables can be initialized for Macintosh applications by editing a resource of type STR# whose name is "Tcl Environment Variables". This resource is part of the tclsh and wish applications. Follow the directions on page 26 for using ResEdit. The format of the resource values is NAME=VALUE. |
p126 | Fixed reference to Table 11-2 from "these tables". |
p126 | Added another example pattern, "(^|\n)to:\[^\n\]+\n" |
p128 | "URl" should be "URL". |
p156 | Note added: history substitute and words operations were removed in Tcl 8.0 |
p163 | Fixed citation of Tcl/Tk Tools (Mark Harrison, ed. O'Reilly & Associates, Inc., 1997) |
p166,167,168,171 | namespace commands need eval keyword |
p172 | First entry in Table 14-1 is not valid. You must use the eval keyword |
p178 | after info takes an optional "id" argument and returns the command for that after event. |
p182 | Bad break after - in -buffersize at end of page. |
p183 | Fixed reference to Table 15-4. |
p184 | Removed first sentence on the page about leaving off parts of the mode value - you need to supply all four parts. |
p186 | Added reference to Scotty. |
p186 | Fixed bad line wrap in sample socket command. |
p190 | Fixed bad line wrap in Example 16-4. |
p191 | Fixed bad line wrap in Example 16-5. |
p193 | Changed Http_Header to HttpHeader. |
p194 | Http_Get has a broken regsub pattern. It should useregsub "HTTP/1.. " $header(http) {} header(http) |
p196 | Fixed bad line wrap in Example 16-10. |
p197 | Fixed font for input output in fcopy example. |
p197 | Added sample fcopy callback procedureproc CopyDone {in out bytes {error {}} { close $in ; close $out } |
p201 | Added description of http 2.0 package, which uses the ::http namespace. The procedures in the package are:http::geturl http::config http::formatQuery http::reset http::data http::status http::error http::code http::wait |
p207 | vwait should be removed from Table 17-2 |
p213 | The safe base was completely re-written to
use the ::safe namespace and to eliminate the package require
facility that loads security policies. The new interface to the safe base
is:
::safe::interpCreate ?slave? ?options...? ::safe::interpInit slave ?options...? ::safe::interpConfigure slave ?options...? ::safe::interpDelete slave ::safe::interpAddToAccessPath slave directory ::safe::interpFindInAccessPath slave directory ::safe::setLogCmd ?cmd arg...?The options to interpCreate, interpInit, and interpConfigure are: -accessPath pathList -noStatics -nestedLoadOk -deleteHook scriptThe slave aliases also include a file alias that allows the
dirname, join, extension, root, tail,
pathname, and split operations. |
p215 | Bad line breaks in example 17-8. |
p216 | Fixed reference to Example 17-10 (was "x"). |
p218 | Font error for tempfile(directory) at top of page. |
p219 | Font error for after at top of page. |
p221 | SafeAfterExitAlias should be:
proc SafeAfterExitAlias {slave} { global after foreach id [array names after id,$slave,*] { after cancel $after($id) unset after($id) } interp delete $slave } |
p229 | Bad line break in Example 18-2 |
p232 | "resources" should be "resource" in the option entry for Table 18-2 |
p241 | Bad line break near the bottom of the page. |
p245 | Fix reference to Example 37-2 on page 481 |
p246 | In EvalTypein, the newline should be inserted
before the text is fetched from the text widget. It should read:
proc EvalTypein {} { global eval $eval(text) insert insert \n set command [$eval(text) get limit end] if [info complete $command] { $eval(text) mark set limit insert Eval $command } } |
p267 | Chapter info text should read "...that positions widgets on a grid that..." |
p274 | The bbox entry in Table 21-1 should read
grid bbox master ?c1 r1? ?c2 r2?The column number comes before the row number. |
p274 | The boolean argument to the propagate operation is optional. |
p274 | The slaves table entry has an extra period after "win", and a bad line break after a hypen. |
p282 | Bad line break in Example 22-7 in $pane(-percent) |
p297 | "lists" should be "listed" in the last entry of Table 23-3 |
p310 | The -default attribute has three possible values: active, disabled, or normal. active displays as a default button. normal and disabled display as a normal button. |
p311 | The -relief attribute can also be solid . |
p313 | Example 24-6 should use -value attributes for the radio buttons (e.g., -value apple) |
p314 | Font error for .menubar in System Menus paragraph. |
p314 | The last sentence should end "...it is an option menu." |
p315 | "indicate" should be "indicated" near top of page |
p318 | In the menu by name package, the global array is menu , not Menu. |
p325 | userdDefault should be userDefault |
p330 | The radio branch of the switch statement in Example 25-7 should supply a -value $l |
p332 | WindowMenuInner should be a recursive call to ResourceMenu in the new ResourceMenu definition. |
p334 | The -relief attribute can also be solid . |
p338 | The -relief attribute can also be solid . |
p340 | The -relief attribute can also be solid . |
p342 | The -relief attribute can also be solid . |
p347 | Repeated "a" in the middle of the page. |
p348 | Bad page breaks after -sticky in Example 27-3. |
p356 | The -relief attribute can also be solid . |
p361 | Bad line break at top of page. |
p367 | The -relief attribute can also be solid . |
p371 | Font error for delete in 2nd paragraph. |
p374 | The -relief attribute can also be solid . |
p374 | Bad line break after hypen in -offset. |
p382 | "that" should be "than" in first paragraph. |
p391 | The first word, "This", should be "The" |
p407 | Font error for index in 4th entry of Table 31-9. |
p410 | Bad line breaks in Example 31-12 after rootx and rooty |
p410 | The -width attribute of canvas text items controls how big they get before they are wrapped. |
p414 | "postscript out" should be "postscript output" in the only paragraph. |
p417 | First column of Table 31-13 should be 10pc (not 9pc) wide to avoid breaking highlightBackground. |
p417 | The -relief attribute can also be solid . |
p417 | Font error for "canvas" in scrollRegion entry of Table 31-13. |
p417 | Put a semi-colon after "totally off the scroll region" |
p423 | Throughout Part V, the Chapter banner is incorrectly formatted. The C H A P T E R is too low because its table cell should be middle aligned, not bottom aligned. |
p423 | Delete "the" before "Macintosh and Windows" in last paragraph. |
p426 | Table 32-2 should have TBleft formatting in the left column. |
p431 | The Chapter banner is incorrectly formatted. |
p441 | Font error for update idletasks in last paragraph. |
p443 | The Chapter banner is incorrectly formatted. |
p447 | The activeBorderWidth and activeRelief attributes only have effect on UNIX. |
p449 | The anchor value for .f.two should be nw , not w , in Example 34-5. |
p451 | The Chapter banner is incorrectly formatted. |
p452 | The activeForeground entry is missing a period after "widget". |
p452 | The disabledForeground entry has a font error on "and". |
p457 | There is a font error for "-visual" in the first sentence. |
p460 | The -channel option listed in Table 35-7 for photo widgets does not exist. It was just wishful thinking on my part. |
p461 | The right-hand column of Table 35-9 is in the wrong font. Should be TB paragraph type. |
p465 | The Chapter banner is incorrectly formatted. |
p469 | Bad line break in Example 36-1 |
p469 | Re-worded Font Failures opening paragraph to start
Unfortunately, if a font is missing, versions of Tk before 8.0 do not attempt to substitute another font, not even fixed. (Tk 8.0 only does substitutions if you use platform-independent font names.) Before Tk 8.0, the widget creation or reconfiguration command raises an error if the font does not exist. |
p471 | Font error for "font" in font measure and font metrics entries of Table 36-3 |
p472 | The hot tip icon is on the wrong side of the page. |
p477 | The Chapter banner is incorrectly formatted. |
p482 | Two periods after browser. |
p483 | The append command should be
append eval(cmdbuf,$sock) $line\nin Example 37-5 |
p484 | Font error for return in last paragraph. |
p487 | The Chapter banner is incorrectly formatted. |
p491 | Font error for "and" in first entry of Table 38-3. |
p491 | Format error for left column of Table 38-3, should be TBleft. |
p495 | Delete sentence: "This value is useful in the selection command." |
p497 | The embedding example should use -containter:
frame .embed -container true |
p498 | Table 38-11 has a font error for "win" in the winfo visual entry. |
p498 | Added note that tk scale was added in Tk 8.0. |
p499 | The Chapter banner is incorrectly formatted. |
p501 | There is a much cleaner and more reliable way to
set preference items in Example 39-2 using the switch statement:
switch -regexp -- $default { ^CHOICE { PrefValueSet $varName [lindex $default 1] } ^OFF { PrefValueSet $varName 0 } ^ON { PrefValueSet $varName 1 } default { # This is a string or numeric PrefValueSet $varName $default } } |
p511 | The Chapter banner is incorrectly formatted. |
p521 | The Chapter banner is incorrectly formatted. |
p530 | The second paragraph was re-written because the
initial reference count of an object is now zero, not one. It reads
The Tcl_NewTypeObj allocates storage for an object and sets its reference count to zero. Tcl_IncrRefCount and Tcl_DecrRefCount increment and decrement the reference count on an object. Tcl_DecrRefCount frees the storage for an object when it goes to zero. The initial reference count of zero was chosen because functions like Tcl_SetObjResult automatically increment the reference count on an object. |
p531 | The * in the "Assert..." comment block are not lined up right. |
p535 | Missing a tab before (char *) &myoption near top of page. |
p536 | Bad line break in the comment inside Example 41-8. |
p539 | All occurrences of if (object) should be
if (info.isNativeObjectProc)Bad line break in the comment inside Example 41-8. Here is a pointer to a cleaned up version of Tcl_Invoke, due to Jean Brouwers. |
p539 | All occurrences of if (object) should be
if (info.isNativeObjectProc)And this should be added after the Tcl_NewStringObj statement: Tcl_IncrRefCount(objv[argc]); |
p540 | All occurrences of if (object) should be
if (info.isNativeObjectProc)After invoking the (*info.objProc) , the two statements that set the string result can be replaced with this simpler call:
(void)Tcl_GetStringResult(interp); |
p544 | First sentence of 2nd paragraph should contain \"used to build\". |
p545 | Bad line breaks in Example 41-12 |
p547 | Bad line break in Example 41-13 on ${SHLIB_LD} command |
p548 | The reference to the examples/C directory should instead be examples/cprog. There is also another example on the CD-ROM in examples/build. |
p549 | The Chapter banner is incorrectly formatted. |
p551 | There are font errors for alloc, realloc, and free in the Memory Allocation section. |
p553 | Delete reference to tcl_precision, which no longer exists. |
p553 | Font error for "Object" in the Tcl Objects section. |
p554 | Font error for "Strings support" in the Primitive Object Types section. |
p559 | Font error for "TkInit" in the Creating Windows section. |
p567 | The Chapter banner is incorrectly formatted. |
p569 | Delete duplicate ckalloc line in Example 43-2. |
p570 | Should save the result of Tcl_CreateCommand for use when deleting the command later.
clockPtr->widgetCmd = Tcl_CreateCommand(interp, Tk_PathName(clockPtr->tkwin), ClockInstanceCmd, (ClientData) clockPtr, (void (*)()) NULL); |
p579 | Use Tcl_DeleteCommandFromToken to handle the case where
the command has been renamed.
Tcl_DeleteCommandFromToken(clockPtr->interp, clockPtr->widgetCmd); |
p585 | The Chapter banner is incorrectly formatted. |
p593 | The Chapter banner is incorrectly formatted. |
p597 | The Chapter banner is incorrectly formatted. |
p599 | The Chapter banner is incorrectly formatted. |
p599 | Typeset all of the first word, "Tcl" in body.initialCap font. |
p599 | Delete the word "featured" in first paragraph. |
p601 | The Safe-Tcl section should no longer talk about
configurable security policies. That function has moved into the Web Browser
plug-in. Instead, it now mentions the safe base:
Initialization of a safe interpreter with a safe base that supports auto loading and a standard exit alias has been abstracted into a Tcl interface. The safe::interpCreate and safe::interpInit procedures create or initialize a slave with the safe base. The safe::interpDelete procedure cleans up. The safe base is described on page 212. |
p601 | Font error for "clock" in the Year 2000 section. |
p601 | Change http_get to http::geturl. The page number reference changes to 201. |
p603 | The first sentence should end "CDE look and feel." |
p603 | The last paragraph now reads
This book first went to press after Tcl/Tk 8.0a2, the 2nd alpha release, and just before the first beta release. I tried to document the last major changes to Tcl/Tk 8.0 such as namespaces, binary I/O, and menu enhancements that appeared in the beta and final versions. However, I could not anticipate every change made before Tcl/Tk 8.0 went final. The rest of this section summarizes updates made in the 2nd and later reprints. Please consult http://www.beedub.com/book/ for errata and news about Tcl/Tk updates. |
p604 | This formerly blank page now summarizes the main changes that were
made to Tcl and Tk after the first printing of the book:
namespace evalThe eval keyword is required when putting code inside namespaces. Other wise there is ambiguity between the other namespace operations (e.g., import) and namespaces with the same name. This affects several of the examples in Chapter 14.http PackageA 2nd version of the http package was created that uses the ::http namespace. The functionality is the same, but the names of the procedures changed. See page 201.Safe-Tcl Safe BaseThe safe base was completely redone. It uses the ::safe namespace and no longer supports the use of package require to request security policies. See page 212.Object Reference CountsThe initial reference count of an object is now zero, not one. This affected the implementation of Tcl_Invoke shown in Example 419 on page 538The Web Browser Plug-inThe plug-in changed a lot. The mechanism to load security policies was shifted from the safe base into the plug-in. Instead of using package require, a new policy command is used by slaves. The set of security policies also changed. As of this printing the plug-in is just going into is 2.0beta2 release. The best doc umentation will probably be on the web at http://sunscript.sun.com/plugin/. |
p605 | The Chapter banner is incorrectly formatted. |
p606 | Example 48-1 should use the -container flag:
set embed [frame $rim.child -container true]This example should use safe::loadTk to correctly load Tk and set up the argv variable for the slave: ::safe::loadTk safetk -use [winfo id $embed] |
p607 | Table 48-1 should not list tkwait, which really is available to slaves. |
p608 | The browser_args variable was renamed embed_args to be compatible with the 1.0 version of the plugin. |
pp609-613 | The rest of this chapter changed substantially because the plug-in implementation change. You might as well look at the on-line version of the chapter. |