Learning Perl/Tk by Nancy Walsh Here are the changes that were made in the 3/99 reprint: (1) Added text to footnote. The text used to read: "Unless you get the Win32 binary from CPAN" It now reads: "Unless you get the Win32 binary from CPAN or another pre-built distribution such as ActiveState Perl" {7} In code snippet near bottom of page, the line used to read: $mw = new MainWindow; # or $mw = MainWindow => new(); $top = $mw -> Toplevel(); $frame = $mw -> Frame (-borderwidth => 2, -relief => "groove"); Now reads: $mw = new MainWindow; # or $mw = MainWindow->new(); $top = $mw->Toplevel(); $frame = $mw->Frame(-borderwidth => 2, -relief => "groove"); Removed spaces as indicated in each line, and changed => to a -> in the first line. (8) Paragraph 4, before 2nd code snippet. Last sentence used to read: "... on its own separate line, after the last option/value pair:" Changed to: "... on its own separate line, after the last option/value pair, which retains the comma for formatting ease:" (8) In the next paragraph this text: "... without having to mess with parentheses and semicolons." Was changed to: "... without having to mess with parentheses, semicolons or commas." <9> Second code snippet on the page used to read: $button -> pack(); Removed spaces so that it reads like this: $button->pack(); <11> On very first line of this page, deleted the comma so the text now reads: "... our window say "Hello World" and create a button ..." {11} Added quotes in the fourth line of sample code, it now reads: $mw->title("Hello World"); <17> The second usage statement for pack used to read: $widget->pack( [ option => value, ] ); Inserted ellipses to indicate additional possible options: $widget->pack( [ option => value, ... ] ); ^^^^^ {17} In code segment, added a quotation mark: don't send any options to pack {35} Added ellipses to first code snippet. It now reads: $widget1->grid( [ $widget2, ... , ] [ option => value, ... ] ); {35} Second paragraph. Second sentence used to read: You can also invoke grid() on each window independently ... Changed to: You can also invoke grid() on each widget independently ... ^^^^^^ {58} In Button Options section, the -anchor option, bolded the 'center' option to show that it is the default. (58) Under -borderwidth option, the second line, the word -relief was spaced widely. Tightened text. (59) Under -highlightbackground option (2nd on page), the text used to read: Sets the color of a nonfocus rectangle. Changed to: Sets the color of the area behind the focus rectangle (shows when widget does not have focus). <59> Under -justify, text used to read: Sets the side of the button against which the text will justify itself. Changed to: Sets the side of the button against which multiline text will justify itself. {59} As part of -relief option, added the -solid option. Now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' {62} The example for creating an anonymous sub showed the following code: sub { # do something } Changed to: sub { .. do something .. } ^^^^^^^^^^^^^^^^^^ And made all indicated by ^^^ above in italics <65> Changed Figure 3-4 so that the second button's text is "Enable Exit," not "Disable Exit." {68} Last line on page, added 'solid'. Text now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' <75> Changed Figure 3-18 so that the second button's text is "Enable Exit," not "Disable Exit." <78> Inserted footnote, placed * in the first sentence on page: "The highlight rectangle* is normally displayed..." ^ Inserted this footnote: *On Win32 systems, the highlight rectangle is drawn as a dashed line within the widget. <78> Deleted the sentence before figure 3-22 that said: (Both buttons in Figure 3-22 have a -highlightthickness of 10) {85} Added 'solid' to the -relief option. Text now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' (85) Under -selectimage option, the text used to read: "Indicates whether image is displayed instead of text ... " Changed to: "Indicates the image to display intead of text..." {91} In Checkbutton Style section now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' {97} The -relief option now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' {110} First line of code snippet on the page now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' <113> Added quotes to list of index types. The text used to read: anchor Changed to: 'anchor' Last index type, end heading. Used to read: end Changed to: 'end' (119) Last code snippet on the page used to read: $entry->index(index); Changed to: $numindex = $entry->index(index); <129> First paragraph, 4th line down. Text used to read: "... -yscrollcommand option has the set command and our scrollbar..." ^^^ Left wording the same, but put the word 'set' in courier font. {130} In -relief option, added 'solid.' Text now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' <133> First code snippet on the page reads: $scrollbar->configure(-command => ['yview' => $lb]); ^^^^^^^ The word -command is italicized, made it normal courier font. <133> In code heading of xviewMoveto and yviewMoveto: $widget->xviewMoveto(fraction); # or $widget->yviewMoveto(fraction); Changed the word 'fraction' in both lines to italics, indicating an argument to be replaced. <137> First paragraph, second sentence reads: "... three possible results from fraction: 0.0..." ^^^^^^^^ The work 'fraction' was in italics but isn't anymore (it is the name of an actual method). (141) The code snippet once read: $lb = $parent->Listbox( options ...)->pack; Changed to: $lb = $parent->Listbox( [ options ...] )->pack; ^^^^^^^^^^^^^^ marked with ^^ is italics. <142> First complete sentence on the page: "... to use the insert method to insert items into it:" ^^^^^^ The second insert was courier font, the first one is now instead: "... to use the insert method to insert items into it:" ^^^^^^ {143} In the -relief option; added 'solid.' Text now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' {156} Added 'solid' to the -relief option: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' <160> In code snippet, second line used to read: ... #ts at 1 inch, 1.5 inch and every _ inch after ^ Took out spaces. {166} In first code example, the first line used to read: $t->Text()->pack(); Changed to: $t = $mw->Text()->pack(); {172} In the 'Deleting Text' paragraph, last sentence: $text->delete(0, 'end') ^^^^ Changed to: $text->delete("1.0", 'end') {184} Second code snippet, used to read: $canvas = $mw->Scrolled("canvas"); Uppercased the c in the quoted word: $canvas = $mw->Scrolled("Canvas"); ^ {184} Third code snippet, same problem. Changed $c = $mw->Scrolled("canvas")->pack; to: $c = $mw->Scrolled("Canvas")->pack; ^ {187} Added 'solid' to the -relief option. Text now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' {188} First paragraph, last sentence used to read: "...the tag or ID is the one returned from the ..." Changed to: "...the ID is what is returned from the ..." {189} Under -start option, second sentence used to read: "... is at three o'clock (8 degrees)." Changed the 8 to a 0: "... is at three o'clock (0 degrees)." {197} In fourth paragraph, first sentence used to read: "... by using selectAdjust: $canvas->select("adjust", ..." Changed to: "... by using selectAdjust: $canvas->selectAdjust(..." ^^^^^^^^^ {198} Code snippet, first line used to read: $canvas->createWindow(0,0, $canvas->Button(-text => "Button", Added the -window option by changing to: $canvas->createWindow(0,0, -window => $canvas->Button(-text => "Button", (200) Second paragraph, second sentence used to read: Items added to the canvas after the "all" tag is called will not... Changed to: Items added to the canvas after the call to addtag will not... ^^^^^^^^^^^^^^^^^^^ Make 'addtag' courier font. {207} In the drawing program example in sub bind_start the test used to read: if ($draw_item eq "rectangle"||#draw_item eq "oval"||..... It now reads: if ($draw_item eq "rectangle"||$draw_item eq "oval"||.... {212} Added 'solid' to -relief option. Text now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' <249> The first line after the code example used to read: "In this example, the written words are displayed in the menu (and are stored in $textvariable)..." It now reads: "In this example, the written words are displayed in the menu (and are stored in $displayed)..." {253} Added 'solid' to the -relief option: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' {259} Added 'solid' to the -relief option. Text now reads: -relief => 'flat' | 'groove' | 'raised' | 'ridge' | 'sunken' | 'solid' {280} The second line in first code snippet used to read: # prints this: Tk::Button.button.all The spaces were missing. Changed to: # prints this: Tk::Button .button . all {280} The fourth line in first code snippet used to read: # prints this: MainWindow.all The spaces were missing. Changed to: # prints this: MainWindow . all {304} Last sentence on page used to read: "...until a variable is set, call waitVariable:" Changed to: "...until a variable's value is changed, call waitVariable:" ^^^^^^^^^^^ {305} Text at top of page used to read: The value of $var must be undefined before you call waitVariable and processing will resume as soon as $var is defined. Changed to: Processing will continue as soon as the value contained within $var is changed to something different. (311) Added text in "The cget Method" section: "It only returns the current value of the option..." Changed to: "It only returns the current value (or address if the option stores a reference) of the option..."